-
Type: Task
-
Resolution: Done
-
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?