Hi Duran,
yes, I can confirm that either on mongoid.yml, as in the same terminal
session where I've performed that test:
Mongoid.config.identity_map_enabled #=> true
I'm on mongoid-10660a2fdfdb, a little bit further than 2.4.3. I was
just wondering if this is the expected behavior. If not, I can regress
and try to find out where it started happening.
The funny thing is that those users are indeed in the identity map at
that point. Mongoid::IdentityMap.get(User,
BSON::ObjectId('4f2b4725a4cd5b55c100000f')) returns the right
document.
Thanks again
On Feb 10, 7:00 am, Durran Jordan <
dur...@gmail.com> wrote:
> Do you have the identity map enabled?
>
> 2012/2/10 Angelim <
ange...@gmail.com>
>
>
>
>
>
>
>
> > Hi guys,
> > I'm having trouble understanding what behavior I should expect from
> > eager loading has_many associations. Let's say we have a User and
> > Comment models. Naturally, a User has many Comments.
> > When I issue the following on console:
> > User.all.includes(:comments).each{|e| e.comments.inspect}
>
> > The mongo driver tells me it's performing the following queries:
> > ['system.namespaces'].find({})
> > ['users'].find({})
> > ['system.namespaces'].find({})
>
> > ['comments'].find({"user_id"=>{"$in"=>[BSON::ObjectId('4f2e761aa4cd5bcea700 000a'),