aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-06-19 10:14:06 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-06-21 00:53:29 +0900
commita26d4ad64b0451301711b7050dea2593c977cfd3 (patch)
tree2b5d41d815201d4d4cd289ccd67d0094201209c9 /activerecord/lib/active_record
parentce459720ec5ef039d1f825c69bd3d929d5885996 (diff)
downloadrails-a26d4ad64b0451301711b7050dea2593c977cfd3.tar.gz
rails-a26d4ad64b0451301711b7050dea2593c977cfd3.tar.bz2
rails-a26d4ad64b0451301711b7050dea2593c977cfd3.zip
`PolymorphicReflection` is not using the methods from `ThroughReflection`
`ThroughReflection` initializes `@delegate_reflection` and delegate all public methods to `delegate_reflection`. But `PolymorphicReflection` does not initialize `@delegate_reflection`. It is enough to inherit `AbstractReflection` (using `alias_candidate` only).
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/reflection.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index bf398b0d40..6684283f03 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -135,8 +135,8 @@ module ActiveRecord
# BelongsToReflection
# HasAndBelongsToManyReflection
# ThroughReflection
- # PolymorphicReflection
- # RuntimeReflection
+ # PolymorphicReflection
+ # RuntimeReflection
class AbstractReflection # :nodoc:
def through_reflection?
false
@@ -981,7 +981,7 @@ module ActiveRecord
end
- class PolymorphicReflection < ThroughReflection # :nodoc:
+ class PolymorphicReflection < AbstractReflection # :nodoc:
def initialize(reflection, previous_reflection)
@reflection = reflection
@previous_reflection = previous_reflection