mongoid/mongoid — Issue #1598: Trouble persisting nested attributes on update, 2.4.1
Author: yeggeps
Created: 2012-01-15 22:27:40+00:00
State: open

I'm having some trouble persisting deeply embedded documents on update (works on create).

```
MONGODB db['vehicles'].update({"_id"=>BSON::ObjectId('4f1349956858c67ebb000003'), "cars._id"=>BSON::ObjectId('4f134b836858c680af000001'), "cars.0.brands._id"=>BSON::ObjectId('4f134b8b6858c680af000002')}, {"$set"=>{"tags"=>[{"name"=>:red, "tag_type"=>:color, "_id"=>BSON::ObjectId('4f134f5e6858c6841d000002')}, {"name"=>:brown, "tag_type"=>:color, "_id"=>BSON::ObjectId('4f134f5e6858c6841d000003')}]}, "$pushAll"=>{"cars.0.brands.0.tags"=>[{"name"=>:red, "tag_type"=>:color, "_id"=>BSON::ObjectId('4f134f5e6858c6841d000001')}, {"name"=>:brown, "tag_type"=>:color, "_id"=>BSON::ObjectId('4f134f5e6858c6841d000002')}]}})
```

```
class Brand
include Mongoid::Document
embedded_in :car
embeds_many :tags, :as => :taggable
end
```

```
class Car
include Mongoid::Document
embedded_in :vehicles
embeds_many :brands
end
```

```
class Vehicle
include Mongoid::Document
embeds_many :cars
end
```

Works fine on 2.3

Looked in the changelog but could have missed something. Is this functionallity changed?