From 6f684478dde8f55f20211f7a4ec0680a44c03225 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Wed, 15 Sep 2010 16:30:09 -0300 Subject: Remove associated object from identity map when reloading. --- activerecord/lib/active_record/associations/association_proxy.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index bfedffcf02..2024cee968 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -110,6 +110,7 @@ module ActiveRecord # Resets the \loaded flag to +false+ and sets the \target to +nil+. def reset @loaded = false + IdentityMap.remove(@target) if defined?(@target) && @target && IdentityMap.enabled? @target = nil end -- cgit v1.2.3