From 9bde73ff72812f6f3c59ad97be6ca6c628e109ea Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Tue, 6 Sep 2011 16:34:32 +0100 Subject: Nested through associations: preloads from the default scope of a through model should not be included in the association scope. (We're already excluding includes.) Fixes #2834. --- activerecord/lib/active_record/associations/through_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb index 81172179e0..b010b5e9ef 100644 --- a/activerecord/lib/active_record/associations/through_association.rb +++ b/activerecord/lib/active_record/associations/through_association.rb @@ -16,7 +16,7 @@ module ActiveRecord chain[1..-1].each do |reflection| scope = scope.merge( reflection.klass.scoped.with_default_scope. - except(:select, :create_with, :includes) + except(:select, :create_with, :includes, :preload) ) end scope -- cgit v1.2.3