-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
When using mongoid's identity map, and doing request that have a "only" or "without" statement, you end up having incomplete records in the identity_map. Here is some code example if you have a User collection with a username field:
User.only(:_id).first #=> #<User _id: joe, _type: nil, created_at: nil, updated_at: nil, username: nil> User.find('joe').username #=> nil Mongoid::IdentityMap.clear #=> {} User.find('joe').username => "joe"
I have some code in preplay/mongoid@6235e72bcaeb62e55d01f33dedf224c999ec5c30 with a test and a fix and I can do a pull request if you think the way of fixing this bug is valid.