-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
I'm running into a problem with 2.0.0beta9 and 2.0.0.beta.14 (we're sticking with rails beta 4 until heroku supports the rc) that appears to be related to http://github.com/durran/mongoid/issues/issue/122, which is closed (I also commented there).
In Mongoid::Atomicity, the _updates method doesn't add the association name or the child index to the updates key, so if a Parent embeds_many :children, then parent.write_attributes(:children => {0 => {:foo => "bar")}} will cause parent._updates to return {"$set" => {"foo" => "bar"}}.
It's not just that the child doesn't get saved (as reported in the other issue), its updated properties get set on the parent and not the child.