lib/mongoid/persistence/insert_embedded.rb in mongoid-2.0.0.rc.6 vs lib/mongoid/persistence/insert_embedded.rb in mongoid-2.0.0.rc.7

- old
+ new

@@ -29,12 +29,13 @@ return document if validate && document.invalid?(:create) parent = document._parent if parent.new_record? parent.insert else - update = { document._inserter => { document._position => document.raw_attributes } } + update = { document._inserter => { document._position => document.as_document } } collection.update(parent._selector, update, options.merge(:multi => false)) document.new_record = false + document.move_changes end document end end end