From 7db93131ed01aa3b64774b81f6c6b78a6012a75a Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 1 Aug 2013 16:27:56 -0700 Subject: use drop and avoid a range object --- activerecord/lib/active_record/associations/through_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb index bd99997e7f..ba7d2a3782 100644 --- a/activerecord/lib/active_record/associations/through_association.rb +++ b/activerecord/lib/active_record/associations/through_association.rb @@ -13,7 +13,7 @@ module ActiveRecord # 2. To get the type conditions for any STI models in the chain def target_scope scope = super - chain[1..-1].each do |reflection| + chain.drop(1).each do |reflection| scope.merge!( reflection.klass.all. except(:select, :create_with, :includes, :preload, :joins, :eager_load) -- cgit v1.2.3