Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2940

min on date gives back the wrong item

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.1.4
    • Affects Version/s: None
    • Component/s: None

      I have a date field:

      class LineItem
        field :event_date, type: Date, default: Time.now.to_date
      end
      

      Running:

      LineItem.min(:event_date)
      

      With many records returns the wrong value:
      "2013-02-15 00:00:00 UTC"

      While running:

      LineItem.only(:event_date).collect(&:event_date).min.to_s
      

      returns:
      "10/12/2011"

            Assignee:
            durran Durran Jordan
            Reporter:
            mb-dev mb-dev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: