Class: SchedulerBookingQuestion
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SchedulerBookingQuestion
- Defined in:
- app/models/scheduler_booking_question.rb
Overview
== Schema Information
Table name: scheduler_booking_questions
Database name: primary
id :bigint not null, primary key
active :boolean default(TRUE), not null
field_type :string default("short_text"), not null
label :string not null
position :integer default(0), not null
required :boolean default(FALSE), not null
created_at :datetime not null
updated_at :datetime not null
scheduler_booking_page_id :bigint not null
Indexes
idx_scheduler_questions_page_position (scheduler_booking_page_id,position)
Foreign Keys
fk_rails_... (scheduler_booking_page_id => scheduler_booking_pages.id) ON DELETE => cascade
Instance Attribute Summary collapse
- #field_type ⇒ Object readonly
- #label ⇒ Object readonly
- #position ⇒ Object readonly
Belongs to collapse
Class Method Summary collapse
-
.active ⇒ ActiveRecord::Relation<SchedulerBookingQuestion>
A relation of SchedulerBookingQuestions that are active.
-
.ordered ⇒ ActiveRecord::Relation<SchedulerBookingQuestion>
A relation of SchedulerBookingQuestions that are ordered.
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Instance Attribute Details
#field_type ⇒ Object (readonly)
29 |
# File 'app/models/scheduler_booking_question.rb', line 29 validates :field_type, presence: true, inclusion: { in: %w[short_text long_text] } |
#label ⇒ Object (readonly)
28 |
# File 'app/models/scheduler_booking_question.rb', line 28 validates :label, presence: true |
#position ⇒ Object (readonly)
30 |
# File 'app/models/scheduler_booking_question.rb', line 30 validates :position, numericality: { only_integer: true, greater_than_or_equal_to: 0 } |
Class Method Details
.active ⇒ ActiveRecord::Relation<SchedulerBookingQuestion>
A relation of SchedulerBookingQuestions that are active. Active Record Scope
32 |
# File 'app/models/scheduler_booking_question.rb', line 32 scope :active, -> { where(active: true) } |
.ordered ⇒ ActiveRecord::Relation<SchedulerBookingQuestion>
A relation of SchedulerBookingQuestions that are ordered. Active Record Scope
33 |
# File 'app/models/scheduler_booking_question.rb', line 33 scope :ordered, -> { order(:position) } |
Instance Method Details
#scheduler_booking_page ⇒ SchedulerBookingPage
26 |
# File 'app/models/scheduler_booking_question.rb', line 26 belongs_to :scheduler_booking_page |