Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use drop and avoid a range object

  • Loading branch information...
commit 7db93131ed01aa3b64774b81f6c6b78a6012a75a 1 parent b60ec0d
@tenderlove tenderlove authored
View
2  activerecord/lib/active_record/associations/through_association.rb
@@ -13,7 +13,7 @@ module ThroughAssociation #:nodoc:
# 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)
Please sign in to comment.
Something went wrong with that request. Please try again.