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

DocumentNotFound initializer does not work as documented

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

      See comments for the initializer here: https://github.com/mongoid/mongoid/blob/master/lib/mongoid/errors/document_not_found.rb

      The comments suggest a new error can be initialized thus:

      DocumentNotFound.new(Person, ["1", "2"])

      This does not actually work, and will result in an ArgumentError being raised on line 25 because the second argument is not a Hash.

      With the current code, initializing an error with a list of ids must be down like this:

      DocumentNotFound.new(Person, nil, ["1", "2"])

      Should the comments be updated, or should the initializer be fixed to reflect what the comments say?

            Assignee:
            Unassigned Unassigned
            Reporter:
            wyattisimo Jared Wyatt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: