Class: EventAuthor
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- EventAuthor
- Defined in:
- app/models/event_author.rb
Overview
== Schema Information
Table name: event_authors
Database name: primary
id :bigint not null, primary key
event_id :bigint not null
employee_id :bigint not null
created_at :datetime not null
updated_at :datetime not null
Indexes
idx_event_authors_unique (event_id,employee_id) UNIQUE
idx_event_authors_lookup (employee_id,event_id)
Foreign Keys
fk_rails_... (event_id => events.id) ON DELETE => cascade
fk_rails_... (employee_id => parties.id) ON DELETE => restrict
Join table: one row per (event, employee-author) pairing on the marketing
calendar. Replaces the legacy single events.creator_id association so an
event can be co-owned by multiple employees. The DB-level unique index plus
the model-level uniqueness validation give a friendly error when the same
employee is added twice to the same event.
Constant Summary
Constants included from Schedulable
Schedulable::SIMPLE_FORM_OPTIONS
Instance Attribute Summary collapse
- #employee_id ⇒ Object readonly
Belongs to collapse
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Schedulable
Methods included from Models::AfterCommittable
Methods included from Models::EventPublishable
Instance Attribute Details
#employee_id ⇒ Object (readonly)
33 |
# File 'app/models/event_author.rb', line 33 validates :employee_id, uniqueness: { scope: :event_id } |