Module: Mongoid::Keys
Overview
This module defines the behaviour for overriding the default ids on documents.
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Instance Method Summary collapse
-
#primary_key ⇒ Array
Get the document’s primary key.
-
#using_object_ids? ⇒ true, false
Is the document using object ids?.
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
9 10 11 |
# File 'lib/mongoid/keys.rb', line 9 def identifier @identifier end |
Instance Method Details
#primary_key ⇒ Array
Note:
Refactored from using delegate for class load performance.
Get the document’s primary key.
24 25 26 |
# File 'lib/mongoid/keys.rb', line 24 def primary_key self.class.primary_key end |
#using_object_ids? ⇒ true, false
Note:
Refactored from using delegate for class load performance.
Is the document using object ids?
36 37 38 |
# File 'lib/mongoid/keys.rb', line 36 def using_object_ids? self.class.using_object_ids? end |