diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-05 18:43:56 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-05 18:43:56 +0000 |
commit | 4f00c70580e376691bd1d6c1f9d09efbaa7bf9c9 (patch) | |
tree | 23865027d66ca498ad6c63c5cbb997ee85dc41d0 /activerecord/test/associations_go_eager_test.rb | |
parent | 84b8920a11985a771e6dbddbf5ed4e3852a2e790 (diff) | |
download | rails-4f00c70580e376691bd1d6c1f9d09efbaa7bf9c9.tar.gz rails-4f00c70580e376691bd1d6c1f9d09efbaa7bf9c9.tar.bz2 rails-4f00c70580e376691bd1d6c1f9d09efbaa7bf9c9.zip |
Fixed eager loading problems with single-table inheritance [Rick Olson] Added smarter table aliasing for eager associations for multiple self joins [Rick Olson] (closes #3580)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_go_eager_test.rb')
-rw-r--r-- | activerecord/test/associations_go_eager_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb index 2212596099..50cb9bec59 100644 --- a/activerecord/test/associations_go_eager_test.rb +++ b/activerecord/test/associations_go_eager_test.rb @@ -94,13 +94,13 @@ class EagerAssociationTest < Test::Unit::TestCase def test_eager_association_loading_with_belongs_to_and_limit_and_multiple_associations posts = Post.find(:all, :include => [:author, :very_special_comment], :limit => 1, :order => 'posts.id') assert_equal 1, posts.length - assert_equal [3], posts.collect { |p| p.id } + assert_equal [1], posts.collect { |p| p.id } end def test_eager_association_loading_with_belongs_to_and_limit_and_offset_and_multiple_associations posts = Post.find(:all, :include => [:author, :very_special_comment], :limit => 1, :offset => 1, :order => 'posts.id') assert_equal 1, posts.length - assert_equal [4], posts.collect { |p| p.id } + assert_equal [2], posts.collect { |p| p.id } end def test_eager_with_has_many_through @@ -108,8 +108,8 @@ class EagerAssociationTest < Test::Unit::TestCase posts_with_author = people(:michael).posts.find(:all, :include => :author ) posts_with_comments_and_author = people(:michael).posts.find(:all, :include => [ :comments, :author ]) assert_equal 2, posts_with_comments.inject(0) { |sum, post| sum += post.comments.size } - assert_equal authors(:david), posts_with_author.first.author - assert_equal authors(:david), posts_with_comments_and_author.first.author + assert_equal authors(:david), assert_no_queries { posts_with_author.first.author } + assert_equal authors(:david), assert_no_queries { posts_with_comments_and_author.first.author } end def test_eager_with_has_many_and_limit |