aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/identity_map.rb
diff options
context:
space:
mode:
authorRichard Millan <richardiux@gmail.com>2011-05-06 10:05:43 -0700
committerRichard Millan <richardiux@gmail.com>2011-05-06 10:05:43 -0700
commitfc2823a85c8c5e4c0415fbb6b9e7d01f020b3036 (patch)
treebf37f7d3d04902ef6eddb69a8b7fd271eb7d0a99 /activerecord/lib/active_record/identity_map.rb
parentd53b406a76db291f9d1ef15685f87a0977f16c89 (diff)
downloadrails-fc2823a85c8c5e4c0415fbb6b9e7d01f020b3036.tar.gz
rails-fc2823a85c8c5e4c0415fbb6b9e7d01f020b3036.tar.bz2
rails-fc2823a85c8c5e4c0415fbb6b9e7d01f020b3036.zip
Adding base method symbolized_sti_name to activerecord base to be used on identity map. Identity map now considers the inheritance when creating the caching keys
Diffstat (limited to 'activerecord/lib/active_record/identity_map.rb')
-rw-r--r--activerecord/lib/active_record/identity_map.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/identity_map.rb b/activerecord/lib/active_record/identity_map.rb
index 9eb47ad99f..f88ead9ca0 100644
--- a/activerecord/lib/active_record/identity_map.rb
+++ b/activerecord/lib/active_record/identity_map.rb
@@ -49,7 +49,7 @@ module ActiveRecord
end
def get(klass, primary_key)
- record = repository[klass.symbolized_base_class][primary_key]
+ record = repository[klass.symbolized_sti_name][primary_key]
if record.is_a?(klass)
ActiveSupport::Notifications.instrument("identity.active_record",
@@ -64,15 +64,15 @@ module ActiveRecord
end
def add(record)
- repository[record.class.symbolized_base_class][record.id] = record
+ repository[record.class.symbolized_sti_name][record.id] = record
end
def remove(record)
- repository[record.class.symbolized_base_class].delete(record.id)
+ repository[record.class.symbolized_sti_name].delete(record.id)
end
- def remove_by_id(symbolized_base_class, id)
- repository[symbolized_base_class].delete(id)
+ def remove_by_id(symbolized_sti_name, id)
+ repository[symbolized_sti_name].delete(id)
end
def clear