From fa1e101d5469729c0b21c234bde85f731d4ce6e4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 18 Jul 2013 15:05:39 -0700 Subject: [PATCH] use the superclass implementation --- .../lib/active_record/associations/association_scope.rb | 2 +- activerecord/lib/active_record/reflection.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb index f1bec5787a..bdfafa5066 100644 --- a/activerecord/lib/active_record/associations/association_scope.rb +++ b/activerecord/lib/active_record/associations/association_scope.rb @@ -119,7 +119,7 @@ module ActiveRecord # the owner klass.table_name else - reflection.table_name + super end end diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 8a9488656b..f470946da5 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -527,7 +527,9 @@ module ActiveRecord # def chain @chain ||= begin - chain = source_reflection.chain + through_reflection.chain + a = source_reflection.chain + b = through_reflection.chain + chain = a + b chain[0] = self # Use self so we don't lose the information from :source_type chain end