diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-08 09:27:36 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-08 09:27:36 -0800 |
commit | 772883c59078484dc8990ffbc509e249e22a6c84 (patch) | |
tree | e2614fd525afd3048a33e73ccab6614ea7c1dd87 /activerecord/test | |
parent | f8ca941f4a0a5a6115a05d06646a6411ebe5aa44 (diff) | |
parent | 6876f4a787249146517b01efaaa0a5b27ee0350b (diff) | |
download | rails-772883c59078484dc8990ffbc509e249e22a6c84.tar.gz rails-772883c59078484dc8990ffbc509e249e22a6c84.tar.bz2 rails-772883c59078484dc8990ffbc509e249e22a6c84.zip |
Merge pull request #8145 from sobrinho/master
Add test to avoid regression of 58e48d5
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/nested_attributes_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb index 9674f2ce94..3f08f9ea4d 100644 --- a/activerecord/test/cases/nested_attributes_test.rb +++ b/activerecord/test/cases/nested_attributes_test.rb @@ -185,6 +185,17 @@ class TestNestedAttributesInGeneral < ActiveRecord::TestCase assert_equal "James", mean_pirate.parrot.name assert_equal "blue", mean_pirate.parrot.color end + + def test_accepts_nested_attributes_for_can_be_overridden_in_subclasses + Pirate.accepts_nested_attributes_for(:parrot) + + mean_pirate_class = Class.new(Pirate) do + accepts_nested_attributes_for :parrot + end + mean_pirate = mean_pirate_class.new + mean_pirate.parrot_attributes = { :name => "James" } + assert_equal "James", mean_pirate.parrot.name + end end class TestNestedAttributesOnAHasOneAssociation < ActiveRecord::TestCase |