Skip to content

Commit 65d584c

Browse files
committed
No need to cache table metadata in advance now that rails#6683 was merged.
1 parent bd8c0b8 commit 65d584c

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

activerecord/test/cases/associations/eager_test.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ class EagerAssociationTest < ActiveRecord::TestCase
2929
:owners, :pets, :author_favorites, :jobs, :references, :subscribers, :subscriptions, :books,
3030
:developers, :projects, :developers_projects, :members, :memberships, :clubs, :sponsors
3131

32-
def setup
33-
# preheat table existence caches
34-
Comment.find_by_id(1)
35-
end
36-
3732
def test_eager_with_has_one_through_join_model_with_conditions_on_the_through
3833
member = Member.scoped(:includes => :favourite_club).find(members(:some_other_guy).id)
3934
assert_nil member.favourite_club
@@ -962,10 +957,6 @@ def test_eager_loading_with_order_on_joined_table_preloads
962957
end
963958

964959
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-
969960
posts = assert_queries(2) do
970961
Post.scoped(:select => 'distinct posts.*', :includes => :author, :joins => [:comments], :where => "comments.body like 'Thank you%'", :order => 'posts.id').all
971962
end
@@ -987,7 +978,6 @@ def test_eager_loading_with_conditions_on_joined_table_preloads
987978
Post.scoped(:includes => :author, :joins => {:taggings => {:tag => :taggings}}, :where => "taggings_tags.super_tag_id=2", :order => 'posts.id').all
988979
end
989980
assert_equal posts(:welcome, :thinking), posts
990-
991981
end
992982

993983
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
1002992
end
1003993
assert_equal [posts(:welcome)], posts
1004994
assert_equal authors(:david), assert_no_queries { posts[0].author}
1005-
1006995
end
1007996

1008997
def test_eager_loading_with_select_on_joined_table_preloads

activerecord/test/cases/associations/has_many_associations_test.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,15 +1353,11 @@ def test_custom_primary_key_on_new_record_should_fetch_with_query
13531353
author = Author.new(:name => "David")
13541354
assert !author.essays.loaded?
13551355

1356-
# cache metadata in advance to avoid extra sql statements executed while testing
1357-
Essay.first
1358-
13591356
assert_queries 1 do
13601357
assert_equal 1, author.essays.size
13611358
end
13621359

13631360
assert_equal author.essays, Essay.where(writer_id: "David")
1364-
13651361
end
13661362

13671363
def test_has_many_custom_primary_key
@@ -1441,7 +1437,6 @@ def test_joins_with_namespaced_model_should_use_correct_type
14411437
:group => "#{Namespaced::Firm.table_name}.id"
14421438
).find firm.id
14431439
assert_equal 1, stats.num_clients.to_i
1444-
14451440
ensure
14461441
ActiveRecord::Base.store_full_sti_class = old
14471442
end

0 commit comments

Comments
 (0)