Displaying 1 result from an estimated 1 matches for "pirate_attributes".
2012 Feb 23
1
Bug in nested_attributes_for: question about best way to patch
...test_should_destroy_an_existing_record_if_there_is_a_matching_id_and_destroy_is_truthy
@ship.pirate.destroy
[1, ''1'', true, ''true''].each do |truth|
pirate = @ship.reload.create_pirate(:catchphrase => ''Arr'')
@ship.update_attributes(:pirate_attributes => { :id =>
pirate.id, :_destroy => truth })
assert_raise(ActiveRecord::RecordNotFound) { pirate.reload }
end
end
I''ve also a partial patch developed: http://pastie.org/3438962
The problem is that to trigger the record deletion, the association
still needs to be there to b...