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

User.find(nil) raises exception

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      I can, of course, do User.find_by(id: nil) instead, but anyone who sees this in the code will always be tempted to correct to User.find(nil) because he won't know the possible passing of nil.

      Would it be possible to simply have the find method return a nil if you call it with a nil?

            Assignee:
            Unassigned Unassigned
            Reporter:
            emirkin Eugene Mirkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: