Displaying 1 result from an estimated 1 matches for "y_is_truthy".
2012 Feb 23
1
Bug in nested_attributes_for: question about best way to patch
...a being saved (foreign key violations) because the
parent record saved still has the association_id set even though the
associated record has been destroyed.
Here is a test demonstrating the error and the expectations:
def
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_rai...