Module: Bronze::Entities::PrimaryKey
- Extended by:
- SleepingKingStudios::Tools::Toolbox::Mixin
- Included in:
- Bronze::Entities::PrimaryKeys::Uuid, Bronze::Entity
- Defined in:
- lib/bronze/entities/primary_key.rb
Overview
Module for defining a primary key attribute on an entity class.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#primary_key ⇒ Object
The primary key for the current entity.
Instance Method Details
#primary_key ⇒ Object
Returns the primary key for the current entity.
62 63 64 65 66 67 68 |
# File 'lib/bronze/entities/primary_key.rb', line 62 def primary_key attribute_name = self.class.primary_key&.name return nil unless attribute_name get_attribute(attribute_name) end |