Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use identity mapper only if enabled.

  • Loading branch information...
commit 09f12a12706593884961a682660f34282e937e46 1 parent e88fd02
@miloops miloops authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/persistence.rb
View
6 activerecord/lib/active_record/persistence.rb
@@ -66,7 +66,7 @@ def save!(*)
def delete
if persisted?
self.class.delete(id)
- IdentityMap.remove(self)
+ IdentityMap.remove(self) if IdentityMap.enabled?
end
@destroyed = true
freeze
@@ -76,7 +76,7 @@ def delete
# that no changes should be made (since they can't be persisted).
def destroy
if persisted?
- IdentityMap.remove(self)
+ IdentityMap.remove(self) if IdentityMap.enabled?
self.class.unscoped.where(self.class.arel_table[self.class.primary_key].eq(id)).delete_all
end
@@ -279,7 +279,7 @@ def create
self.id ||= new_id
- IdentityMap.add(self)
+ IdentityMap.add(self) if IdentityMap.enabled?
@persisted = true
id
end
Please sign in to comment.
Something went wrong with that request. Please try again.