diff options
author | pavel <pavel.rosicky@easy.cz> | 2017-10-26 23:16:54 +0200 |
---|---|---|
committer | pavel <pavel.rosicky@easy.cz> | 2017-10-27 01:09:11 +0200 |
commit | d95fbd7dba54cfbd282f808102dfdffa3499d669 (patch) | |
tree | fe4a5a7c6253321e2da64d60c22a0bb673a7f1e8 /activerecord/test/cases | |
parent | 12de5e202ddfca27cccc5965b3048e88718a9ace (diff) | |
download | rails-d95fbd7dba54cfbd282f808102dfdffa3499d669.tar.gz rails-d95fbd7dba54cfbd282f808102dfdffa3499d669.tar.bz2 rails-d95fbd7dba54cfbd282f808102dfdffa3499d669.zip |
fix initial count
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 4 |
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! } |