diff options
author | Emilio Tagua <miloops@gmail.com> | 2011-02-18 15:38:00 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2011-02-18 15:38:00 -0300 |
commit | 15a03ca9b0b9a3582ca0f7695ed87557eedc95fb (patch) | |
tree | 0a0ef7d059ebf8a33e8e2f27550565f45ff8b512 /activerecord | |
parent | 0b702ba3de42ed2ae8855843127f898102802b77 (diff) | |
download | rails-15a03ca9b0b9a3582ca0f7695ed87557eedc95fb.tar.gz rails-15a03ca9b0b9a3582ca0f7695ed87557eedc95fb.tar.bz2 rails-15a03ca9b0b9a3582ca0f7695ed87557eedc95fb.zip |
No need to test against target anymore.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/identity_map_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb index bed464dbce..16da188476 100644 --- a/activerecord/test/cases/identity_map_test.rb +++ b/activerecord/test/cases/identity_map_test.rb @@ -105,15 +105,15 @@ class IdentityMapTest < ActiveRecord::TestCase assert_no_queries do comment.post end - assert_same post, comment.post.target + assert_same post, comment.post end def test_associated_object_are_assigned_from_identity_map post = Post.find(1) post.comments.each do |comment| - assert_same post, comment.post.target - assert_equal post.object_id, comment.post.target.object_id + assert_same post, comment.post + assert_equal post.object_id, comment.post.object_id end end @@ -176,7 +176,7 @@ class IdentityMapTest < ActiveRecord::TestCase pirate.reload pirate.birds_attributes = [{ :id => posideons.id, :name => 'Grace OMalley' }] - assert_equal 'Grace OMalley', pirate.birds.send(:load_target).find { |r| r.id == posideons.id }.name + assert_equal 'Grace OMalley', pirate.birds.send(:load).find { |r| r.id == posideons.id }.name end def test_changing_associations @@ -267,20 +267,20 @@ class IdentityMapTest < ActiveRecord::TestCase posts = Post.find(:all, :select => 'distinct posts.*', :include => :author, :joins => [:comments], :conditions => "comments.body like 'Thank you%'", :order => 'posts.id') assert_equal [posts(:welcome)], posts assert_equal authors(:david), assert_no_queries { posts[0].author} - assert_same posts.first.author.target, Author.first + assert_same posts.first.author, Author.first posts = Post.find(:all, :select => 'distinct posts.*', :include => :author, :joins => [:comments], :conditions => "comments.body like 'Thank you%'", :order => 'posts.id') assert_equal [posts(:welcome)], posts assert_equal authors(:david), assert_no_queries { posts[0].author} - assert_same posts.first.author.target, Author.first + assert_same posts.first.author, Author.first posts = Post.find(:all, :include => :author, :joins => {:taggings => :tag}, :conditions => "tags.name = 'General'", :order => 'posts.id') assert_equal posts(:welcome, :thinking), posts - assert_same posts.first.author.target, Author.first + assert_same posts.first.author, Author.first posts = Post.find(:all, :include => :author, :joins => {:taggings => {:tag => :taggings}}, :conditions => "taggings_tags.super_tag_id=2", :order => 'posts.id') assert_equal posts(:welcome, :thinking), posts - assert_same posts.first.author.target, Author.first + assert_same posts.first.author, Author.first end def test_eager_loading_with_conditions_on_string_joined_table_preloads |