aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/reflection.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 2f73300abf..774df46246 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -13,10 +13,12 @@ module ActiveRecord
def create_reflection(macro, name, options, active_record)
case macro
when :has_many, :belongs_to, :has_one, :has_and_belongs_to_many
- reflections[name] = AssociationReflection.new(macro, name, options, active_record)
+ reflection = AssociationReflection.new(macro, name, options, active_record)
when :composed_of
- reflections[name] = AggregateReflection.new(macro, name, options, active_record)
+ reflection = AggregateReflection.new(macro, name, options, active_record)
end
+ write_inheritable_hash :reflections, name => reflection
+ reflection
end
def reflections