From 1468a4b89aa4bca99160bfa03572b2c0ab348db5 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 30 Jul 2013 16:21:33 -0700 Subject: all `scope_chain` methods allocate new arrays, no need to dup --- activerecord/lib/active_record/reflection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/reflection.rb') diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 73d154e03e..2fa7b1194d 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -564,7 +564,7 @@ module ActiveRecord # of scopes corresponding to the chain. def scope_chain @scope_chain ||= begin - scope_chain = source_reflection.scope_chain.map(&:dup) + scope_chain = source_reflection.scope_chain # Add to it the scope from this reflection (if any) scope_chain.first << scope if scope -- cgit v1.2.3