From a8dd21d8b459ce4d57160a359798c577085a95e9 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 2 Mar 2012 00:10:06 -0300 Subject: Remove IdentityMap --- activerecord/lib/active_record/associations/association.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'activerecord/lib/active_record/associations/association.rb') diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index 512c52338e..fb0ca15c23 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -45,7 +45,6 @@ module ActiveRecord # Resets the \loaded flag to +false+ and sets the \target to +nil+. def reset @loaded = false - IdentityMap.remove(target) if IdentityMap.enabled? && target @target = nil end @@ -135,17 +134,7 @@ module ActiveRecord # ActiveRecord::RecordNotFound is rescued within the method, and it is # not reraised. The proxy is \reset and +nil+ is the return value. def load_target - if find_target? - begin - if IdentityMap.enabled? && association_class && association_class.respond_to?(:base_class) - @target = IdentityMap.get(association_class, owner[reflection.foreign_key]) - end - rescue NameError - nil - ensure - @target ||= find_target - end - end + @target ||= find_target if find_target? loaded! unless loaded? target rescue ActiveRecord::RecordNotFound -- cgit v1.2.3