aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-03 19:57:35 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-03 19:57:35 -0200
commit7c3bc58b54c68245b8abf8a41a9a9a4f7339e5c6 (patch)
treea6d2c014cb3d6610975cc1004295eb62d06cfc4e /activerecord
parent66bcaff0620e0b4ba1c7cc711f356007a65d12ec (diff)
downloadrails-7c3bc58b54c68245b8abf8a41a9a9a4f7339e5c6.tar.gz
rails-7c3bc58b54c68245b8abf8a41a9a9a4f7339e5c6.tar.bz2
rails-7c3bc58b54c68245b8abf8a41a9a9a4f7339e5c6.zip
Ensure nested attributes is restored in case of a test failure
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/nested_attributes_test.rb2
1 files changed, 1 insertions, 1 deletions
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