diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-02 03:27:31 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-02 03:27:31 +0000 |
commit | b1ea27630df0f0639900b321d756091b42ed29f7 (patch) | |
tree | 4372f5dc041745269ebba322ba6dd902b43792f6 /activerecord/test/cases/associations_test.rb | |
parent | 9d79e0668d6a51573170ee568c5bac6717ec1a0c (diff) | |
download | rails-b1ea27630df0f0639900b321d756091b42ed29f7.tar.gz rails-b1ea27630df0f0639900b321d756091b42ed29f7.tar.bz2 rails-b1ea27630df0f0639900b321d756091b42ed29f7.zip |
Fix has_many :through a polymorphic has_many. Closes #10529 [Aleksey Kondratenko]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/cases/associations_test.rb')
-rwxr-xr-x | activerecord/test/cases/associations_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb index 0df508d01d..cfc58ffa10 100755 --- a/activerecord/test/cases/associations_test.rb +++ b/activerecord/test/cases/associations_test.rb @@ -16,6 +16,10 @@ require 'models/tag' require 'models/tagging' require 'models/person' require 'models/reader' +require 'models/parrot' +require 'models/pirate' +require 'models/treasure' +require 'models/price_estimate' class AssociationsTest < ActiveRecord::TestCase fixtures :accounts, :companies, :developers, :projects, :developers_projects, @@ -1607,7 +1611,8 @@ end class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase - fixtures :accounts, :companies, :categories, :posts, :categories_posts, :developers, :projects, :developers_projects + fixtures :accounts, :companies, :categories, :posts, :categories_posts, :developers, :projects, :developers_projects, + :parrots, :pirates, :treasures, :price_estimates def test_has_and_belongs_to_many david = Developer.find(1) @@ -2143,6 +2148,10 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase tag.save! end end + + def test_has_many_through_polymorphic_has_manys_works + assert_equal [10, 20].to_set, pirates(:redbeard).treasure_estimates.map(&:price).to_set + end end |