From 1d7221c5087581a3752e4dab67ca2d27e93d4a1f Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 21 Jan 2013 23:23:25 +0900 Subject: Preload some join table schemas --- .../test/cases/associations/nested_through_associations_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/activerecord/test/cases/associations/nested_through_associations_test.rb b/activerecord/test/cases/associations/nested_through_associations_test.rb index 03d99d19f6..e355ed3495 100644 --- a/activerecord/test/cases/associations/nested_through_associations_test.rb +++ b/activerecord/test/cases/associations/nested_through_associations_test.rb @@ -221,6 +221,9 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase end def test_has_many_through_has_many_with_has_and_belongs_to_many_source_reflection_preload_via_joins + # preload table schemas + Author.joins(:post_categories).first + assert_includes_and_joins_equal( Author.where('categories.id' => categories(:cooking).id), [authors(:bob)], :post_categories @@ -246,6 +249,9 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase end def test_has_many_through_has_and_belongs_to_many_with_has_many_source_reflection_preload_via_joins + # preload table schemas + Category.joins(:post_comments).first + assert_includes_and_joins_equal( Category.where('comments.id' => comments(:more_greetings).id).order('categories.id'), [categories(:general), categories(:technology)], :post_comments @@ -271,6 +277,9 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase end def test_has_many_through_has_many_with_has_many_through_habtm_source_reflection_preload_via_joins + # preload table schemas + Author.joins(:category_post_comments).first + assert_includes_and_joins_equal( Author.where('comments.id' => comments(:does_it_hurt).id).order('authors.id'), [authors(:david), authors(:mary)], :category_post_comments -- cgit v1.2.3