Class: SchedulerHost
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SchedulerHost
- Defined in:
- app/models/scheduler_host.rb
Overview
== Schema Information
Table name: scheduler_hosts
Database name: primary
id :bigint not null, primary key
priority :integer default(0), not null
created_at :datetime not null
updated_at :datetime not null
employee_id :bigint not null
scheduler_booking_page_id :bigint not null
Indexes
idx_scheduler_hosts_page_employee (scheduler_booking_page_id,employee_id) UNIQUE
index_scheduler_hosts_on_employee_id (employee_id)
Foreign Keys
fk_rails_... (employee_id => parties.id) ON DELETE => cascade
fk_rails_... (scheduler_booking_page_id => scheduler_booking_pages.id) ON DELETE => cascade
Instance Attribute Summary collapse
- #employee_id ⇒ Object readonly
Belongs to collapse
Class Method Summary collapse
-
.by_priority ⇒ ActiveRecord::Relation<SchedulerHost>
A relation of SchedulerHosts that are by priority.
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Instance Attribute Details
#employee_id ⇒ Object (readonly)
28 |
# File 'app/models/scheduler_host.rb', line 28 validates :employee_id, uniqueness: { scope: :scheduler_booking_page_id, message: 'is already a host for this booking page' } |
Class Method Details
.by_priority ⇒ ActiveRecord::Relation<SchedulerHost>
A relation of SchedulerHosts that are by priority. Active Record Scope
30 |
# File 'app/models/scheduler_host.rb', line 30 scope :by_priority, -> { order(:priority) } |
Instance Method Details
#scheduler_booking_page ⇒ SchedulerBookingPage
25 |
# File 'app/models/scheduler_host.rb', line 25 belongs_to :scheduler_booking_page |