Permalink
Browse files

use drop and avoid a range object

  • Loading branch information...
1 parent b60ec0d commit 7db93131ed01aa3b64774b81f6c6b78a6012a75a @tenderlove tenderlove committed Aug 1, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/through_association.rb
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)

0 comments on commit 7db9313

Please sign in to comment.