diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-10-20 16:11:59 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:08:56 -0300 |
commit | 93daf1b80984eab80f0da13c2b42ae76b63085e3 (patch) | |
tree | 115da5500d0ed24ebffb4b40abaa7beeb517daf1 /activerecord/test/cases/associations/eager_test.rb | |
parent | 69b627ef670b1dc7fee0b5d25903cebdeed49576 (diff) | |
download | rails-93daf1b80984eab80f0da13c2b42ae76b63085e3.tar.gz rails-93daf1b80984eab80f0da13c2b42ae76b63085e3.tar.bz2 rails-93daf1b80984eab80f0da13c2b42ae76b63085e3.zip |
Revert "IdentityMap - Adjustments to test cases"
This reverts commit 4db9dca55e3acc2c59f252eb83ecb83db5f4b81b.
Conflicts:
activerecord/test/cases/identity_map_test.rb
Diffstat (limited to 'activerecord/test/cases/associations/eager_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 1782309b3e..c00b8a1cde 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -170,7 +170,6 @@ class EagerAssociationTest < ActiveRecord::TestCase author = authors(:david) post = author.post_about_thinking_with_last_comment last_comment = post.last_comment - ActiveRecord::IdentityMap.clear # We need to clear cache to force reload in next block author = assert_queries(3) { Author.find(author.id, :include => {:post_about_thinking_with_last_comment => :last_comment})} # find the author, then find the posts, then find the comments assert_no_queries do assert_equal post, author.post_about_thinking_with_last_comment @@ -182,7 +181,6 @@ class EagerAssociationTest < ActiveRecord::TestCase post = posts(:welcome) author = post.author author_address = author.author_address - ActiveRecord::IdentityMap.clear # We need to clear cache to force reload in next block post = assert_queries(3) { Post.find(post.id, :include => {:author_with_address => :author_address}) } # find the post, then find the author, then find the address assert_no_queries do assert_equal author, post.author_with_address @@ -785,7 +783,6 @@ class EagerAssociationTest < ActiveRecord::TestCase end def test_eager_loading_with_conditions_on_joined_table_preloads - ActiveRecord::IdentityMap.without do # IM caches records, so we need to disable it to test this functionality. posts = assert_queries(2) do Post.find(:all, :select => 'distinct posts.*', :include => :author, :joins => [:comments], :conditions => "comments.body like 'Thank you%'", :order => 'posts.id') end @@ -807,11 +804,10 @@ class EagerAssociationTest < ActiveRecord::TestCase Post.find(:all, :include => :author, :joins => {:taggings => {:tag => :taggings}}, :conditions => "taggings_tags.super_tag_id=2", :order => 'posts.id') end assert_equal posts(:welcome, :thinking), posts - end + end def test_eager_loading_with_conditions_on_string_joined_table_preloads - ActiveRecord::IdentityMap.without do # IM caches records, so we need to disable it to test this functionality. posts = assert_queries(2) do Post.find(:all, :select => 'distinct posts.*', :include => :author, :joins => "INNER JOIN comments on comments.post_id = posts.id", :conditions => "comments.body like 'Thank you%'", :order => 'posts.id') end @@ -823,7 +819,7 @@ class EagerAssociationTest < ActiveRecord::TestCase end assert_equal [posts(:welcome)], posts assert_equal authors(:david), assert_no_queries { posts[0].author} - end + end def test_eager_loading_with_select_on_joined_table_preloads |