-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
When using accepts_nested_attributes_for and trying to destroy more than one embedded doc update throws an exception, see the failing integration spec (stack trace included): http://gist.github.com/476822.
Failing code:
person = Person.new
person.favorites.build(:title => "Johnny")
person.favorites.build(:title => "Ice cream")
person.favorites.build(:title => "Coke")
person.favorites.build(:title => "Sugar")
person.save!
@attributes = {
"0" =>
"1" => { "_destroy" => "1" }
,
}
person.update_attributes :favorites_attributes => @attributes