Module: ActiveModelPersistence::PrimaryKey
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Attributes, ActiveModel::Model
- Included in:
- Indexable, Persistence, PrimaryKeyIndex
- Defined in:
- lib/active_model_persistence/primary_key.rb
Overview
Exposes the ‘primary_key` accessor to read or write the primary key attribute value
The primary key should be a unique (within its model class) identifier for a model.
By default, the ‘primary_key` accessors maps to the `id` attribute. You can change the attribute by setting the `primary_key` at the class level.
Defined Under Namespace
Modules: ClassMethods