-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
When accessing referenced children of a model at initialization an invalid query is constructed. See the code below for a test case:
class Nut
include Mongoid::Document
end
class Squirrel
include Mongoid::Document
references_and_referenced_in_many :nuts, :class_name => "Nut", :validate => false
def test=(aaa)
self.nuts.inspect # breaks
end
end
Step to Reproduce (type into the console)
- Squirrel.new({ :test => "hello" })
The above will cause the following error Mongo::OperationFailure: invalid query, and the invalid query is MONGODB dev['nuts'].find({:_id=>{"$in"=>nil)}}