aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/test/cases/nested_attributes_test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb
index 2ae9cb4888..15c45ca60e 100644
--- a/activerecord/test/cases/nested_attributes_test.rb
+++ b/activerecord/test/cases/nested_attributes_test.rb
@@ -624,9 +624,13 @@ module NestedAttributesOnACollectionAssociationTests
end
def test_should_automatically_build_new_associated_models_for_each_entry_in_a_hash_where_the_id_is_missing
+ attributes = ActiveSupport::OrderedHash.new
+ attributes['foo'] = { :name => 'Grace OMalley' }
+ attributes['bar'] = { :name => 'Privateers Greed' }
+
@pirate.send(@association_name).destroy_all
@pirate.reload.attributes = {
- association_getter => { 'foo' => { :name => 'Grace OMalley' }, 'bar' => { :name => 'Privateers Greed' }}
+ association_getter => attributes
}
assert !@pirate.send(@association_name).first.persisted?