-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Calling Model.find with an invalidly formatted BSON::ObjectID used to throw a BSON::InvalidObjectId error in Mongoid 2.x
However, in Mongoid 3, it seems it throws a Mongoid::DocumentNotFound error instead of a Moped::BSON::InvalidObjectId error as expected. Is there some sort of option to have it throw the InvalidObjectId error again?
id = Moped::BSON::ObjectId.new => "51e476877a93d0e9ac00000d" Player.find(id) Mongoid::Errors::DocumentNotFound: Player.find('abc') Mongoid::Errors::DocumentNotFound: