aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/nested_attributes_test.rb
diff options
context:
space:
mode:
authorFranck Verrot <franck@verrot.fr>2011-07-19 17:32:16 +0200
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-20 15:40:01 -0700
commit8bc314b3b7dca6d3c796760ace1bb9c1d4cadf53 (patch)
tree01f07d52f34d880e164e50fbc5a4f2aa2252b353 /activerecord/test/cases/nested_attributes_test.rb
parentd8736b266b00e58b8f8f29259913d9306605da14 (diff)
downloadrails-8bc314b3b7dca6d3c796760ace1bb9c1d4cadf53.tar.gz
rails-8bc314b3b7dca6d3c796760ace1bb9c1d4cadf53.tar.bz2
rails-8bc314b3b7dca6d3c796760ace1bb9c1d4cadf53.zip
assign_nested_attributes_for_collection_association should work with Ruby 1.9 [Closes #2106]
Children attributes can be either String's or Symbol's, so let's check if the object responds to to_i.
Diffstat (limited to 'activerecord/test/cases/nested_attributes_test.rb')
-rw-r--r--activerecord/test/cases/nested_attributes_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb
index 6568eb1d18..67a9ed6cd8 100644
--- a/activerecord/test/cases/nested_attributes_test.rb
+++ b/activerecord/test/cases/nested_attributes_test.rb
@@ -755,6 +755,11 @@ module NestedAttributesOnACollectionAssociationTests
Interest.reflect_on_association(:man).options[:inverse_of] = :interests
end
+ def test_can_use_symbols_as_object_identifier
+ @pirate.attributes = { :parrots_attributes => { :foo => { :name => 'Lovely Day' }, :bar => { :name => 'Blown Away' } } }
+ assert_nothing_raised(NoMethodError) { @pirate.save! }
+ end
+
private
def association_setter