Class: SubFloorType

Inherits:
ApplicationRecord show all
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

Class Method Summary collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Schedulable

config

Methods included from Models::AfterCommittable

#after_commit

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.activeActiveRecord::Relation<SubFloorType>

A relation of SubFloorTypes that are active. Active Record Scope

Returns:

See Also:



38
# File 'app/models/sub_floor_type.rb', line 38

scope :active, -> { where(is_active: true).by_name }

.by_nameActiveRecord::Relation<SubFloorType>

A relation of SubFloorTypes that are by name. Active Record Scope

Returns:

See Also:



37
# File 'app/models/sub_floor_type.rb', line 37

scope :by_name, -> { order("sub_floor_types.name DESC") }

.options_for_selectObject



40
41
42
# File 'app/models/sub_floor_type.rb', line 40

def self.options_for_select
  active.by_name.map { |sf| [sf.name.to_s, sf.id] }
end

Instance Method Details

#floor_typesActiveRecord::Relation<FloorType>

Returns:

See Also:



35
# File 'app/models/sub_floor_type.rb', line 35

has_many :floor_types, through: :heating_element_product_line_options

#heating_element_product_line_optionsActiveRecord::Relation<HeatingElementProductLineOption>

Returns:

See Also:



34
# File 'app/models/sub_floor_type.rb', line 34

has_many :heating_element_product_line_options, inverse_of: :sub_floor_type

#room_configurationsActiveRecord::Relation<RoomConfiguration>

Returns:

  • (ActiveRecord::Relation<RoomConfiguration>)

See Also:



32
# File 'app/models/sub_floor_type.rb', line 32

has_many :room_configurations

#showcasesActiveRecord::Relation<Showcase>

Returns:

See Also:



33
# File 'app/models/sub_floor_type.rb', line 33

has_many :showcases