aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorChris Geihsler <chris@geihsler.net>2012-09-29 18:32:56 -0400
committerChris Geihsler <cgeihsler@thinkthroughmath.com>2013-04-03 18:41:12 -0400
commit453c7d6c47be01c9938af14962279e4cb2d6e506 (patch)
tree8acdefb677b3edab11136ca2113dea98e0d839c4 /activerecord/test/cases
parent488699166c3558963fa82d4689a35f8c3fd93f47 (diff)
downloadrails-453c7d6c47be01c9938af14962279e4cb2d6e506.tar.gz
rails-453c7d6c47be01c9938af14962279e4cb2d6e506.tar.bz2
rails-453c7d6c47be01c9938af14962279e4cb2d6e506.zip
Chained scopes will be preloaded properly. Fixes #7490
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/relations_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index ada4294401..98fe6b7611 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -332,6 +332,13 @@ class RelationTest < ActiveRecord::TestCase
end
end
+ def test_preload_applies_to_all_chained_preloaded_scopes
+ assert_queries(3) do
+ post = Post.with_tags.with_comments.first
+ assert post
+ end
+ end
+
def test_find_with_included_associations
assert_queries(2) do
posts = Post.includes(:comments).order('posts.id')