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

Model.find('jkfjdkslfas') results changed on upgrade to 2.4.2

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

      In Mongoid 2.3.4:

      irb(main):001:0> Place.find('jfdkaslfjksdalfsl')
      Mongoid::Errors::DocumentNotFound: Document not found for class Place with id(s) jfdkaslfjksdalfsl.
      

      In Mongoid 2.4.2:

      ruby-1.9.2-p290 :043 > Place.find('jfkdalsfjdsa')
      BSON::InvalidObjectId: illegal ObjectId format: jfkdalsfjdsa
      

      Considering users could visit /places/whatever_they_want I would expect Mongoid to continue to throw DocumentNotFound so it bubbles up as a 404.

      Was this change intentional?

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

              Created:
              Updated:
              Resolved: