From 7c3bc58b54c68245b8abf8a41a9a9a4f7339e5c6 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sat, 3 Nov 2012 19:57:35 -0200 Subject: [PATCH] Ensure nested attributes is restored in case of a test failure --- activerecord/test/cases/nested_attributes_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb index 533920fe8c..9674f2ce94 100644 --- a/activerecord/test/cases/nested_attributes_test.rb +++ b/activerecord/test/cases/nested_attributes_test.rb @@ -489,7 +489,7 @@ class TestNestedAttributesOnABelongsToAssociation < ActiveRecord::TestCase @ship.update_attributes(:pirate_attributes => { :id => @ship.pirate.id, :_destroy => '1' }) assert_nothing_raised(ActiveRecord::RecordNotFound) { @ship.pirate.reload } - + ensure Ship.accepts_nested_attributes_for :pirate, :allow_destroy => true, :reject_if => proc { |attributes| attributes.empty? } end