diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-11 17:05:54 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-11 17:05:54 +0200 |
commit | 85cc1fa657f441417f36998a32a6a158c2697aad (patch) | |
tree | 457d830160931a39a07509a65346b248e97bc5e0 /activerecord/test/cases/nested_attributes_test.rb | |
parent | b4976ce91ba003942acd3f285c6b4fb308657a69 (diff) | |
download | rails-85cc1fa657f441417f36998a32a6a158c2697aad.tar.gz rails-85cc1fa657f441417f36998a32a6a158c2697aad.tar.bz2 rails-85cc1fa657f441417f36998a32a6a158c2697aad.zip |
Revert "Don't overwrite unsaved updates when loading an association but preserve the order of the loaded records. [#4642 state:open]"
This commit introduced a regression described in ticket [#4830].
This reverts commit 0265c708b9696c3943518ad5f3dabdc22c5eba11.
Diffstat (limited to 'activerecord/test/cases/nested_attributes_test.rb')
-rw-r--r-- | activerecord/test/cases/nested_attributes_test.rb | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb index a87683bd97..685b11cb03 100644 --- a/activerecord/test/cases/nested_attributes_test.rb +++ b/activerecord/test/cases/nested_attributes_test.rb @@ -466,20 +466,6 @@ module NestedAttributesOnACollectionAssociationTests assert_equal 'Grace OMalley', @child_1.reload.name end - def test_should_not_overwrite_unsaved_updates_when_loading_association - @pirate.reload - @pirate.send(association_setter, [{ :id => @child_1.id, :name => 'Grace OMalley' }]) - @pirate.send(@association_name).send(:load_target) - assert_equal 'Grace OMalley', @pirate.send(@association_name).target.find { |r| r.id == @child_1.id }.name - end - - def test_should_preserve_order_when_not_overwriting_unsaved_updates - @pirate.reload - @pirate.send(association_setter, [{ :id => @child_1.id, :name => 'Grace OMalley' }]) - @pirate.send(@association_name).send(:load_target) - assert_equal @pirate.send(@association_name).target.first.id, @child_1.id - end - def test_should_take_a_hash_with_composite_id_keys_and_assign_the_attributes_to_the_associated_models @child_1.stubs(:id).returns('ABC1X') @child_2.stubs(:id).returns('ABC2X') |