{"issue":{"created_at":"2011-10-31T21:54:11Z","state":"closed","updated_at":"2011-11-25T17:30:09Z","comments":3,"user":{"gravatar_id":"a58d6b71afc3d1f9eba3e16838639f0a","id":50309,"url":"https://api.github.com/users/gudleik","login":"gudleik","avatar_url":"https://secure.gravatar.com/avatar/a58d6b71afc3d1f9eba3e16838639f0a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"```ruby \r\nclass Foo\r\n  include Mongoid::Document\r\n  field :position, type: Integer\r\nend\r\n\r\nFoo.create!\r\nFoo.max(:position)   # => \"start\"\r\nFoo.min(:position)   # => \"start\"\r\nFoo.max(:whatever)   # => \"start\"\r\n```\r\n\r\nShouldn't #max and #min return nil or 0 instead?","assignee":null,"number":1392,"id":2102664,"labels":[{"name":"bug","color":"e10c02","url":"https://api.github.com/repos/mongoid/mongoid/labels/bug"},{"name":"confirmed","color":"e10c02","url":"https://api.github.com/repos/mongoid/mongoid/labels/confirmed"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"#max and #min returns \"start\" when field is nil","closed_at":"2011-11-07T14:11:23Z","html_url":"https://github.com/mongoid/mongoid/issues/1392","url":"https://api.github.com/repos/mongoid/mongoid/issues/1392","milestone":{"created_at":"2011-10-25T11:31:09Z","state":"closed","due_on":"2011-11-21T08:00:00Z","closed_issues":20,"creator":{"gravatar_id":"6f09262a13427532461b0b618d445b1e","id":9030,"url":"https://api.github.com/users/durran","login":"durran","avatar_url":"https://secure.gravatar.com/avatar/6f09262a13427532461b0b618d445b1e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":29,"description":"","title":"2.3.4","url":"https://api.github.com/repos/mongoid/mongoid/milestones/29","open_issues":0}},"action":"created","comment":{"created_at":"2011-11-25T17:30:09Z","updated_at":"2011-11-25T17:30:09Z","user":{"gravatar_id":"7b9ce58f19b43b87e66fa70e6a65cdab","id":252162,"url":"https://api.github.com/users/maximeg","login":"maximeg","avatar_url":"https://secure.gravatar.com/avatar/7b9ce58f19b43b87e66fa70e6a65cdab?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I just saw this bug.\r\n\r\nBut i'm sorry, it can't return 0 for max & min when there is no values. It's a nonsense.\r\nIt should return nil.\r\n\r\nFor sum, that's ok, 0 is really expected in such a case.","id":2876498,"url":"https://api.github.com/repos/mongoid/mongoid/issues/comments/2876498"}}