aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-04 20:48:54 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-08-04 20:48:54 -0300
commitcaadbd85c1a50ff8bc50d08aa01c046278a9eb1c (patch)
tree4bf3cf6d5d53d75b1b8476e8c6ffa8bed41d4234 /activerecord/lib
parentcfb8d4ad3de3b2ea36d0237e2967bfed1a47c56b (diff)
parent80af2a4935158b0d46a451d18c77971a7e0ca9e1 (diff)
downloadrails-caadbd85c1a50ff8bc50d08aa01c046278a9eb1c.tar.gz
rails-caadbd85c1a50ff8bc50d08aa01c046278a9eb1c.tar.bz2
rails-caadbd85c1a50ff8bc50d08aa01c046278a9eb1c.zip
Merge pull request #16396 from eileencodes/dont-delegate-chain-to-through-association
Don't delegate Reflection#chain to ThroughAssociation
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/through_association.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb
index 24cb5ab545..611d471e62 100644
--- a/activerecord/lib/active_record/associations/through_association.rb
+++ b/activerecord/lib/active_record/associations/through_association.rb
@@ -3,7 +3,7 @@ module ActiveRecord
module Associations
module ThroughAssociation #:nodoc:
- delegate :source_reflection, :through_reflection, :chain, :to => :reflection
+ delegate :source_reflection, :through_reflection, :to => :reflection
protected
@@ -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.drop(1).each do |reflection|
+ reflection.chain.drop(1).each do |reflection|
relation = reflection.klass.all
relation.merge!(reflection.scope) if reflection.scope