aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-04-06 04:16:08 +0000
committerRick Olson <technoweenie@gmail.com>2006-04-06 04:16:08 +0000
commit31d8169e3ecb0a63db3a3bd6130f5d8bbcd0f39a (patch)
tree455a2d2920857887d66e8dd0fa594a847609e1f3 /activerecord/test
parent42d8548e94395435ccc00b453a4db65aca157726 (diff)
downloadrails-31d8169e3ecb0a63db3a3bd6130f5d8bbcd0f39a.tar.gz
rails-31d8169e3ecb0a63db3a3bd6130f5d8bbcd0f39a.tar.bz2
rails-31d8169e3ecb0a63db3a3bd6130f5d8bbcd0f39a.zip
Fixed that loading including associations returns all results if Load IDs For Limited Eager Loading returns none (closes #4528) [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4179 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/associations_go_eager_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb
index 9eb1b96baf..324e8eb231 100644
--- a/activerecord/test/associations_go_eager_test.rb
+++ b/activerecord/test/associations_go_eager_test.rb
@@ -138,6 +138,16 @@ class EagerAssociationTest < Test::Unit::TestCase
assert_equal count, posts.size
end
+ def test_eager_with_has_many_and_limit_ond_high_offset
+ posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10, :conditions => [ "authors.name = ?", 'David' ])
+ assert_equal 0, posts.size
+ end
+
+ def test_count_eager_with_has_many_and_limit_ond_high_offset
+ posts = Post.count(:all, :include => [ :author, :comments ], :limit => 2, :offset => 10, :conditions => [ "authors.name = ?", 'David' ])
+ assert_equal 0, posts
+ end
+
def test_eager_with_has_many_and_limit_with_no_results
posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2, :conditions => "posts.title = 'magic forest'")
assert_equal 0, posts.size