@@ -29,11 +29,6 @@ class EagerAssociationTest < ActiveRecord::TestCase
29
29
:owners , :pets , :author_favorites , :jobs , :references , :subscribers , :subscriptions , :books ,
30
30
:developers , :projects , :developers_projects , :members , :memberships , :clubs , :sponsors
31
31
32
- def setup
33
- # preheat table existence caches
34
- Comment . find_by_id ( 1 )
35
- end
36
-
37
32
def test_eager_with_has_one_through_join_model_with_conditions_on_the_through
38
33
member = Member . scoped ( :includes => :favourite_club ) . find ( members ( :some_other_guy ) . id )
39
34
assert_nil member . favourite_club
@@ -962,10 +957,6 @@ def test_eager_loading_with_order_on_joined_table_preloads
962
957
end
963
958
964
959
def test_eager_loading_with_conditions_on_joined_table_preloads
965
- # cache metadata in advance to avoid extra sql statements executed while testing
966
- Tagging . first
967
- Tag . first
968
-
969
960
posts = assert_queries ( 2 ) do
970
961
Post . scoped ( :select => 'distinct posts.*' , :includes => :author , :joins => [ :comments ] , :where => "comments.body like 'Thank you%'" , :order => 'posts.id' ) . all
971
962
end
@@ -987,7 +978,6 @@ def test_eager_loading_with_conditions_on_joined_table_preloads
987
978
Post . scoped ( :includes => :author , :joins => { :taggings => { :tag => :taggings } } , :where => "taggings_tags.super_tag_id=2" , :order => 'posts.id' ) . all
988
979
end
989
980
assert_equal posts ( :welcome , :thinking ) , posts
990
-
991
981
end
992
982
993
983
def test_eager_loading_with_conditions_on_string_joined_table_preloads
@@ -1002,7 +992,6 @@ def test_eager_loading_with_conditions_on_string_joined_table_preloads
1002
992
end
1003
993
assert_equal [ posts ( :welcome ) ] , posts
1004
994
assert_equal authors ( :david ) , assert_no_queries { posts [ 0 ] . author }
1005
-
1006
995
end
1007
996
1008
997
def test_eager_loading_with_select_on_joined_table_preloads
0 commit comments