From 143769051bcf5b3a7600744be2d8db6e9c859288 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Wed, 7 Sep 2011 09:26:02 +0100 Subject: Don't include any of includes, preload, joins, eager_load in the through association scope. --- activerecord/lib/active_record/associations/through_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations/through_association.rb') diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb index b010b5e9ef..b347a94978 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, :preload) + except(:select, :create_with, :includes, :preload, :joins, :eager_load) ) end scope -- cgit v1.2.3