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

#max and #min returns "start" when field is nil

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

       
      class Foo
        include Mongoid::Document
        field :position, type: Integer
      end
      
      Foo.create!
      Foo.max(:position)   # => "start"
      Foo.min(:position)   # => "start"
      Foo.max(:whatever)   # => "start"
      

      Shouldn't #max and #min return nil or 0 instead?

            Assignee:
            Unassigned Unassigned
            Reporter:
            gudleik gudleik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: