diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-21 14:44:46 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-21 14:44:46 +0200 |
commit | 01add55d6a6a67fb487afa040998575111511b6d (patch) | |
tree | 9b7917090588314729b18a4023e03edead3d1a6c /activerecord/test | |
parent | 96b2516c3cbcf900f2e84163baba3db7cb0e37d9 (diff) | |
download | rails-01add55d6a6a67fb487afa040998575111511b6d.tar.gz rails-01add55d6a6a67fb487afa040998575111511b6d.tar.bz2 rails-01add55d6a6a67fb487afa040998575111511b6d.zip |
Revert "save on parent should not cascade to child unless child changed [#3353 state:open]"
Please check Lighthouse for more information.
This reverts commit 4a0d7c1a439c6ad8d35bf514761824e51fa07df2.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/autosave_association_test.rb | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb index 48479bb429..3b89c12a3f 100644 --- a/activerecord/test/cases/autosave_association_test.rb +++ b/activerecord/test/cases/autosave_association_test.rb @@ -632,8 +632,6 @@ class TestDestroyAsPartOfAutosaveAssociation < ActiveRecord::TestCase end def test_should_rollback_destructions_if_an_exception_occurred_while_saving_a_parent - #association save method only trigged when association is changed - @ship.pirate.catchphrase = "new catch phrase" # Stub the save method of the @ship.pirate instance to destroy and then raise an exception class << @ship.pirate def save(*args) @@ -882,22 +880,6 @@ class TestAutosaveAssociationOnABelongsToAssociation < ActiveRecord::TestCase @pirate = @ship.create_pirate(:catchphrase => "Don' botharrr talkin' like one, savvy?") end - def test_should_not_call_belongs_to_after_save_callbacks_if_no_changes - @ship.attributes = { :name => "Titanic", :pirate_attributes => {:id => @pirate.id} } - #here there are no changes to pirate so if save on ship causes save on pirate - #this callback will fail pirate save.(pirate save shouldn't happen) - @ship.pirate.cancel_save_from_callback = true - @ship.save - assert_equal 'Titanic', @ship.reload.name - end - - def test_should_call_belongs_to_save_if_belongs_to_has_changes - @ship.attributes = { :name => "Titanic", :pirate_attributes => { :catchphrase => 'Jack', :id => @pirate.id} } - @ship.save - assert_equal 'Titanic', @ship.reload.name - assert_equal 'Jack', @pirate.reload.catchphrase - end - def test_should_still_work_without_an_associated_model @pirate.destroy @ship.reload.name = "The Vile Insanity" |