Permalink
Browse files

Merge pull request #10049 from vipulnsward/optimize_around_merge_v1

optimize some code around merge
  • Loading branch information...
2 parents b3efea8 + 0566853 commit db924e1257f37dff441fee7c6e2bbd8ba382d7a6 @rafaelfranca rafaelfranca committed Apr 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/through_association.rb
@@ -14,7 +14,7 @@ module ThroughAssociation #:nodoc:
def target_scope
scope = super
chain[1..-1].each do |reflection|
- scope = scope.merge(
+ scope.merge!(
reflection.klass.all.with_default_scope.
except(:select, :create_with, :includes, :preload, :joins, :eager_load)
)

0 comments on commit db924e1

Please sign in to comment.