mongoid/mongoid — Issue #1808: Eager loading does two queries
Author: fbjork
Created: 2012-03-09 17:57:18+00:00
State: open

Whenever I eager load associations I see duplicate queries in my logs, with the second query including the included foreign key. Bug?

```ruby
blog = Blog.first
posts = blog.posts.includes(:user).limit(10).to_a

MONGODB mydb_development['posts'].find({:_id=>{"$in"=>[BSON::ObjectId('4f03bdb813a7734267000004'), BSON::ObjectId('4f03b66f13a7734267000002')]}})
MONGODB mydb_development['posts'].find({:_id=>{"$in"=>[BSON::ObjectId('4f03bdb813a7734267000004'), BSON::ObjectId('4f03b66f13a7734267000002')]}}, {"user_id"=>1})
```