Permalink
Browse files

Minor improvement: Use the merge method on the relation instead of in…

…stance_eval directly.
  • Loading branch information...
Jan Habermann
Jan Habermann committed Apr 3, 2014
1 parent 384984d commit 47a04b8bbf35238639b00bfab500a84607d8d871
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/through_association.rb
@@ -15,7 +15,7 @@ def target_scope
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)

0 comments on commit 47a04b8

Please sign in to comment.