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)
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 Models::EventPublishable
Class Method Details
.active ⇒ ActiveRecord::Relation<SubFloorType>
A relation of SubFloorTypes that are active. Active Record Scope
39 |
# File 'app/models/sub_floor_type.rb', line 39 scope :active, -> { where(:is_active => true).by_name } |
.by_name ⇒ ActiveRecord::Relation<SubFloorType>
A relation of SubFloorTypes that are by name. Active Record Scope
38 |
# File 'app/models/sub_floor_type.rb', line 38 scope :by_name, -> { order("sub_floor_types.name DESC") } |
.options_for_select ⇒ Object
41 42 43 |
# File 'app/models/sub_floor_type.rb', line 41 def self. return self.active.by_name.map {|sf| ["#{sf.name}", sf.id]} end |
Instance Method Details
#floor_types ⇒ ActiveRecord::Relation<FloorType>
36 |
# File 'app/models/sub_floor_type.rb', line 36 has_many :floor_types, :through => :heating_element_product_line_options |
#heating_element_product_line_options ⇒ ActiveRecord::Relation<HeatingElementProductLineOption>
35 |
# File 'app/models/sub_floor_type.rb', line 35 has_many :heating_element_product_line_options, :inverse_of => :sub_floor_type |
#room_configurations ⇒ ActiveRecord::Relation<RoomConfiguration>
33 |
# File 'app/models/sub_floor_type.rb', line 33 has_many :room_configurations |
#showcases ⇒ ActiveRecord::Relation<Showcase>
34 |
# File 'app/models/sub_floor_type.rb', line 34 has_many :showcases |