diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-05-16 17:07:21 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-05-22 21:25:02 +0100 |
commit | d7a910e31e839e5544aa9f83f9922ecfcee74ed5 (patch) | |
tree | e27b725c1805246b2dd07aabec5fda5caf8d259e /activerecord/test/cases/associations/has_many_associations_test.rb | |
parent | 8c19ebe5539fae896a1a6fb2549e9e63445b6607 (diff) | |
download | rails-d7a910e31e839e5544aa9f83f9922ecfcee74ed5.tar.gz rails-d7a910e31e839e5544aa9f83f9922ecfcee74ed5.tar.bz2 rails-d7a910e31e839e5544aa9f83f9922ecfcee74ed5.zip |
Fix problem with loading polymorphic associations which have been defined in an abstract superclass. Fixes #552.
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 522ac56d82..43974fd895 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -11,6 +11,7 @@ require 'models/comment' require 'models/person' require 'models/reader' require 'models/tagging' +require 'models/tag' require 'models/invoice' require 'models/line_item' require 'models/car' @@ -1468,4 +1469,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase bulb = car.bulbs.build({ :bulb_type => :custom }, :as => :admin) assert_equal CustomBulb, bulb.class end + + def test_abstract_class_with_polymorphic_has_many + post = SubStiPost.create! :title => "fooo", :body => "baa" + tagging = Tagging.create! :taggable => post + assert_equal [tagging], post.taggings + end end |