Method: Mongoid::IdentityMap#remove

Defined in:
lib/mongoid/identity_map.rb

#remove(document) ⇒ Document?

Remove the document from the identity map.

Examples:

Remove the document.

map.removed(person)

Parameters:

  • The document to remove.

Returns:

  • The removed document.

Since:

  • 2.1.0



48
49
50
51
# File 'lib/mongoid/identity_map.rb', line 48

def remove(document)
  return nil unless Mongoid.identity_map_enabled? && document && document.id
  documents_for(document.class).delete(document.id)
end