From 47a04b8bbf35238639b00bfab500a84607d8d871 Mon Sep 17 00:00:00 2001 From: Jan Habermann Date: Thu, 3 Apr 2014 19:03:31 +0200 Subject: Minor improvement: Use the merge method on the relation instead of instance_eval directly. --- 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 942abf7df1..ce65948133 100644 --- a/activerecord/lib/active_record/associations/through_association.rb +++ b/activerecord/lib/active_record/associations/through_association.rb @@ -15,7 +15,7 @@ module ActiveRecord scope = super chain.drop(1).each do |reflection| relation = reflection.klass.all - relation.instance_eval(&reflection.scope) if reflection.scope + relation.merge!(reflection.scope) if reflection.scope scope.merge!( relation.except(:select, :create_with, :includes, :preload, :joins, :eager_load) -- cgit v1.2.3