mongoid/mongoid — pull request #1768 by m3talsmith (2012-02-28 06:06:34+00:00)
Title: 2.4.0 stable

We fixed a bug in Mongoid::Document#update_attributes with mixed existing nested attributes and new attributes where only the existing attributes were updating; the new attributes weren't being created. An example would be where we have the following:

```ruby
{ nested_set: {
id: 'some bson hash',
some_field: 'an awesome field',
{ nested_sets_attributes: [
nested_set: {
id: 'another bson hash',
some_field: 'another awesome field',
{ nested_sets_attributes: [
nested_set: {
some_field: 'a new nested set'
}
] }
}
]}
}

If you found the first nested set and updated with a hash like that via update_attributes would only update the known nested_sets and not create the last entity.