min on date gives back the wrong item

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 3.1.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 Jordan
              Reporter:
              mb-dev
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: