diff options
Diffstat (limited to 'activerecord/test/cases/associations/nested_through_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/nested_through_associations_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/nested_through_associations_test.rb b/activerecord/test/cases/associations/nested_through_associations_test.rb index b879ac9fb8..03d99d19f6 100644 --- a/activerecord/test/cases/associations/nested_through_associations_test.rb +++ b/activerecord/test/cases/associations/nested_through_associations_test.rb @@ -505,7 +505,7 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase def test_nested_has_many_through_with_conditions_on_through_associations_preload_via_joins # Pointless condition to force single-query loading assert_includes_and_joins_equal( - Author.where('tags.id = tags.id'), + Author.where('tags.id = tags.id').references(:tags), [authors(:bob)], :misc_post_first_blue_tags ) end @@ -515,7 +515,7 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase end def test_nested_has_many_through_with_conditions_on_source_associations_preload - authors = assert_queries(2) { Author.includes(:misc_post_first_blue_tags_2).to_a.sort_by(&:id) } + authors = assert_queries(4) { Author.includes(:misc_post_first_blue_tags_2).to_a.sort_by(&:id) } blue = tags(:blue) assert_no_queries do @@ -526,7 +526,7 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase def test_nested_has_many_through_with_conditions_on_source_associations_preload_via_joins # Pointless condition to force single-query loading assert_includes_and_joins_equal( - Author.where('tags.id = tags.id'), + Author.where('tags.id = tags.id').references(:tags), [authors(:bob)], :misc_post_first_blue_tags_2 ) end @@ -560,7 +560,7 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase actual = assert_queries(1) { query.joins(association).to_a.uniq } assert_equal expected, actual - actual = assert_queries(1) { query.eager_load(association).to_a.uniq } + actual = assert_queries(1) { query.includes(association).to_a.uniq } assert_equal expected, actual end end |