diff options
author | Jan Habermann <jan@habermann24.com> | 2014-04-03 19:03:31 +0200 |
---|---|---|
committer | Jan Habermann <jan@habermann24.com> | 2014-04-03 19:03:31 +0200 |
commit | 47a04b8bbf35238639b00bfab500a84607d8d871 (patch) | |
tree | ae67cb0fe805fe879b14a655d07ee540305af707 /activerecord/lib | |
parent | 384984d7ca188d1dae59b204650b8319de9f9f05 (diff) | |
download | rails-47a04b8bbf35238639b00bfab500a84607d8d871.tar.gz rails-47a04b8bbf35238639b00bfab500a84607d8d871.tar.bz2 rails-47a04b8bbf35238639b00bfab500a84607d8d871.zip |
Minor improvement: Use the merge method on the relation instead of instance_eval directly.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/through_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |