Class: Mongoid::Identity

Inherits:
Object show all
Defined in:
lib/mongoid/identity.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.create(doc) ⇒ Object

Create the identity for the Document.

The id will be set in either in the form of a Mongo ObjectId or a composite key set up by defining a key on the document.

The _type will be set to the document’s class name.



11
12
13
# File 'lib/mongoid/identity.rb', line 11

def create(doc)
  identify(doc); type(doc); doc
end