Get a document from the identity map by its id.
Get the document from the map.
map.get(Person, id)
Parameters:
The class of the document.
The document id or selector.
Returns:
The matching document.
Since:
2.1.0
33 34 35 36
# File 'lib/mongoid/identity_map.rb', line 33 def get(klass, identifier) return nil unless Mongoid.identity_map_enabled? && klass documents_for(klass)[identifier] end