primary_key()
click to toggle source
Get the document’s primary key.
@note Refactored from using delegate for class load performance.
@example Get the primary key.
model.primary_key
@return [ Array ] The primary key
# File lib/mongoid/keys.rb, line 23 def primary_key self.class.primary_key end