aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-10-27 09:18:36 +0900
committerGitHub <noreply@github.com>2017-10-27 09:18:36 +0900
commit27265ee57c9420e233c877c7280cb8df53e31e0a (patch)
treefe4a5a7c6253321e2da64d60c22a0bb673a7f1e8 /activerecord/test
parent12de5e202ddfca27cccc5965b3048e88718a9ace (diff)
parentd95fbd7dba54cfbd282f808102dfdffa3499d669 (diff)
downloadrails-27265ee57c9420e233c877c7280cb8df53e31e0a.tar.gz
rails-27265ee57c9420e233c877c7280cb8df53e31e0a.tar.bz2
rails-27265ee57c9420e233c877c7280cb8df53e31e0a.zip
Merge pull request #30995 from ahorek/fix_initial_count
fix initial count
Diffstat (limited to 'activerecord/test')
-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 c6a4ac356f..1dbc407fd1 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -1258,6 +1258,10 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert_equal [comments(:eager_other_comment1)], authors(:mary).unordered_comments
end
+ def test_has_many_trough_with_scope_should_accept_string_and_hash_join
+ assert_equal authors(:david), Author.joins({ comments_for_first_author: :post }, "inner join posts posts_alias on authors.id = posts_alias.author_id").eager_load(:categories).take
+ end
+
def test_has_many_through_with_scope_should_respect_table_alias
family = Family.create!
users = 3.times.map { User.create! }