-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Mongoid 3.0.1
Query code:
@topic= Topic.includes(:replies => [:user]).where(:_id => params[:id]).first
That code can run in 3.0.0.rc, but not 3.0.1
Error messages:
undefined method `stores_foreign_key?' for nil:NilClass
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:538:in `eager_loaded_ids'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:519:in `block in eager_load'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:518:in `reject!'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:518:in `eager_load'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:653:in `block in with_eager_loading'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:632:in `selecting'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:650:in `with_eager_loading'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual/mongo.rb:200:in `first'
# /Users/jason/.rvm/gems/ruby-1.9.3-p0/gems/mongoid-3.0.1/lib/mongoid/contextual.rb:18:in `first'