Affects Version/s: None
Fix Version/s: 3.1.3
Now i want to load all events with the given name and eager load their children.
The query is
I see the following queries in the moped debug output
I guarantee that identity map is enabled in my environment (the following steps would confirm).
So i jumped into the MONGOID gem and added a bunch of print statements to debug this. I found the difference was in these two methods IdentityMap.set_many and IdentityMap.get_many.
In particular, when mongoid puts the information in identity map, the selector looks like this
If you see closely, the selector includes the type array.
However, when mongoid tries to fetch the data from the identity map, the identifier looks like this
The type field is not included in the search and hence Identity map returns nil. I am not sure how to fix this but any help would be very useful.