aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_through_associations_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-06-11 07:57:26 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-06-11 08:11:39 +0900
commita81d47aa413bb31b06b1b8b22411a49a2b119a0e (patch)
treee6acd0a0e66609154de30f435979e70fdf91c277 /activerecord/test/cases/associations/has_many_through_associations_test.rb
parentfcfe29cd2641b2ce3c01bc13f39d617ec302fc8d (diff)
downloadrails-a81d47aa413bb31b06b1b8b22411a49a2b119a0e.tar.gz
rails-a81d47aa413bb31b06b1b8b22411a49a2b119a0e.tar.bz2
rails-a81d47aa413bb31b06b1b8b22411a49a2b119a0e.zip
Fix alias confliction when joining same table on has many through with left_joins
This regression was caused by #30995 due to `Hash#fetch` won't invoke default proc. Just revert the change since #30995 is completely fixed by e9c1653. Fixes #33048.
Diffstat (limited to 'activerecord/test/cases/associations/has_many_through_associations_test.rb')
-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 46fa36d7dd..d5573b6d02 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -1289,6 +1289,10 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert_equal authors(:david), Author.joins(:comments_for_first_author).take
end
+ def test_has_many_through_with_left_joined_same_table_with_through_table
+ assert_equal [comments(:eager_other_comment1)], authors(:mary).comments.left_joins(:post)
+ end
+
def test_has_many_through_with_unscope_should_affect_to_through_scope
assert_equal [comments(:eager_other_comment1)], authors(:mary).unordered_comments
end