aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-08-01 16:27:56 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-08-01 16:28:11 -0700
commit7db93131ed01aa3b64774b81f6c6b78a6012a75a (patch)
tree702c7650959018b6a5f0979fee050e777064a26c /activerecord
parentb60ec0d81d24a9269272fe3102cff1fbe335be16 (diff)
downloadrails-7db93131ed01aa3b64774b81f6c6b78a6012a75a.tar.gz
rails-7db93131ed01aa3b64774b81f6c6b78a6012a75a.tar.bz2
rails-7db93131ed01aa3b64774b81f6c6b78a6012a75a.zip
use drop and avoid a range object
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/through_association.rb2
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 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)