aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations/join_model_test.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-10-15 16:37:11 +0000
committerRick Olson <technoweenie@gmail.com>2006-10-15 16:37:11 +0000
commitcdb5132c411db0a330e85ec9d2eb7fe543af7aff (patch)
tree92114f1a60fc65e8b3f9a4bc5d7ab60a6f4b47e4 /activerecord/test/associations/join_model_test.rb
parent39963b4b9df7f6c3e7d29c91dfdd1e8279f51e60 (diff)
downloadrails-cdb5132c411db0a330e85ec9d2eb7fe543af7aff.tar.gz
rails-cdb5132c411db0a330e85ec9d2eb7fe543af7aff.tar.bz2
rails-cdb5132c411db0a330e85ec9d2eb7fe543af7aff.zip
Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations/join_model_test.rb')
-rw-r--r--activerecord/test/associations/join_model_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/associations/join_model_test.rb b/activerecord/test/associations/join_model_test.rb
index 2c7902a695..1124a0ace0 100644
--- a/activerecord/test/associations/join_model_test.rb
+++ b/activerecord/test/associations/join_model_test.rb
@@ -463,6 +463,10 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
assert_nothing_raised { authors(:david).comments.sum(:post_id) }
end
+ def test_has_many_through_has_many_with_sti
+ assert_equal [comments(:does_it_hurt)], authors(:david).special_post_comments
+ end
+
private
# create dynamic Post models to allow different dependency options
def find_post_with_dependency(post_id, association, association_name, dependency)