aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-10-08 06:45:32 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-10-08 06:45:32 +0000
commit0c3c131f3b9a82d3e2f36b2930c3437c9f821b6d (patch)
tree4cd7f72d3f4f6b5197185b3efa987ecd0cd08097 /activerecord/test
parent6c0609fafb387f2f61ba9eb9754c31bdebeb46ec (diff)
downloadrails-0c3c131f3b9a82d3e2f36b2930c3437c9f821b6d.tar.gz
rails-0c3c131f3b9a82d3e2f36b2930c3437c9f821b6d.tar.bz2
rails-0c3c131f3b9a82d3e2f36b2930c3437c9f821b6d.zip
The has_many create method works with polymorphic associations. Closes #6361.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/associations/join_model_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/associations/join_model_test.rb b/activerecord/test/associations/join_model_test.rb
index fb8df9c21c..c67956fba3 100644
--- a/activerecord/test/associations/join_model_test.rb
+++ b/activerecord/test/associations/join_model_test.rb
@@ -137,6 +137,13 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
assert_equal "Post", tagging.taggable_type
assert_equal old_count+1, posts(:welcome).taggings.count
end
+
+ def test_create_bang_polymorphic_with_has_many_scope
+ old_count = posts(:welcome).taggings.count
+ tagging = posts(:welcome).taggings.create!(:tag => tags(:misc))
+ assert_equal "Post", tagging.taggable_type
+ assert_equal old_count+1, posts(:welcome).taggings.count
+ end
def test_create_polymorphic_has_one_with_scope
old_count = Tagging.count