aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-29 15:01:17 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-29 15:05:47 +0100
commit735d985b0162976e7e900cf36d4cbb0d657fb5e9 (patch)
tree6d28ea963504b2f458b81eb6c32ac471b937f316 /activerecord/test/cases
parentfd22d040fef48778a519825dd2f0cf2fd73a8965 (diff)
downloadrails-735d985b0162976e7e900cf36d4cbb0d657fb5e9.tar.gz
rails-735d985b0162976e7e900cf36d4cbb0d657fb5e9.tar.bz2
rails-735d985b0162976e7e900cf36d4cbb0d657fb5e9.zip
The join_nodes must be passed to the JoinDependency initializer and therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index 5f2328ff95..b703c96ec1 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -821,4 +821,8 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert person.posts.loaded?, 'person.posts should be loaded'
assert_equal [], person.posts
end
+
+ def test_explicitly_joining_join_table
+ assert_equal owners(:blackbeard).toys, owners(:blackbeard).toys.with_pet
+ end
end