aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-02-25 23:32:24 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-02-25 23:32:24 +0000
commitc350291ae7f9f0014d25575a1f0f13070c0b1c0c (patch)
tree868010a934c22cf27c1693309e5b0e1e2726b591 /activerecord/lib/active_record
parent67a978be5d6857785c08b464b0ef4555298da14b (diff)
downloadrails-c350291ae7f9f0014d25575a1f0f13070c0b1c0c.tar.gz
rails-c350291ae7f9f0014d25575a1f0f13070c0b1c0c.tar.bz2
rails-c350291ae7f9f0014d25575a1f0f13070c0b1c0c.zip
Fixed that reflections would bleed across class boundaries in single-table inheritance setups (closes #3796) [lars@pind.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3650 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-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