Class: SubFloorType
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SubFloorType
- Defined in:
- app/models/sub_floor_type.rb
Overview
== Schema Information
Table name: sub_floor_types
Database name: primary
id :integer not null, primary key
is_active :boolean default(TRUE), not null
name :string(255)
seo_key :string
Indexes
index_sub_floor_types_on_seo_key (seo_key)
Constant Summary
Constants included from Schedulable
Schedulable::SIMPLE_FORM_OPTIONS
Has many collapse
- #floor_types ⇒ ActiveRecord::Relation<FloorType>
- #heating_element_product_line_options ⇒ ActiveRecord::Relation<HeatingElementProductLineOption>
- #room_configurations ⇒ ActiveRecord::Relation<RoomConfiguration>
- #showcases ⇒ ActiveRecord::Relation<Showcase>
Class Method Summary collapse
-
.active ⇒ ActiveRecord::Relation<SubFloorType>
A relation of SubFloorTypes that are active.
-
.by_name ⇒ ActiveRecord::Relation<SubFloorType>
A relation of SubFloorTypes that are by name.
- .options_for_select ⇒ Object
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
Class Method Details
.active ⇒ ActiveRecord::Relation<SubFloorType>
A relation of SubFloorTypes that are active. Active Record Scope
38 |
# File 'app/models/sub_floor_type.rb', line 38 scope :active, -> { where(is_active: true).by_name } |
.by_name ⇒ ActiveRecord::Relation<SubFloorType>
A relation of SubFloorTypes that are by name. Active Record Scope
37 |
# File 'app/models/sub_floor_type.rb', line 37 scope :by_name, -> { order("sub_floor_types.name DESC") } |
.options_for_select ⇒ Object
40 41 42 |
# File 'app/models/sub_floor_type.rb', line 40 def self. active.by_name.map { |sf| [sf.name.to_s, sf.id] } end |
Instance Method Details
#floor_types ⇒ ActiveRecord::Relation<FloorType>
35 |
# File 'app/models/sub_floor_type.rb', line 35 has_many :floor_types, through: :heating_element_product_line_options |
#heating_element_product_line_options ⇒ ActiveRecord::Relation<HeatingElementProductLineOption>
34 |
# File 'app/models/sub_floor_type.rb', line 34 has_many :heating_element_product_line_options, inverse_of: :sub_floor_type |
#room_configurations ⇒ ActiveRecord::Relation<RoomConfiguration>
32 |
# File 'app/models/sub_floor_type.rb', line 32 has_many :room_configurations |
#showcases ⇒ ActiveRecord::Relation<Showcase>
33 |
# File 'app/models/sub_floor_type.rb', line 33 has_many :showcases |