Class: QeDataStatistic

Inherits:
ApplicationRecord show all
Defined in:
app/models/qe_data_statistic.rb

Overview

== Schema Information

Table name: qe_data_statistics
Database name: primary

id :integer not null, primary key
application_type :string(255)
coverage_state :string(255) default("0"), not null
expansion_joint_spacing :decimal(8, 2)
heating_system_type_code :string(255)
zone_length :decimal(8, 2)
zone_sqft :decimal(8, 2)
zone_width :decimal(8, 2)
catalog_id :integer
floor_type_id :integer

Indexes

index_qe_data_statistics_on_application_type (application_type)
index_qe_data_statistics_on_catalog_id (catalog_id)
index_qe_data_statistics_on_coverage_state (coverage_state)
index_qe_data_statistics_on_floor_type_id (floor_type_id)
index_qe_data_statistics_on_heating_system_type_code (heating_system_type_code)

Has one collapse

Instance Method Summary collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Instance Method Details

#expansion_joint_spacing_defined?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'app/models/qe_data_statistic.rb', line 49

def expansion_joint_spacing_defined?
  self.expansion_joint_spacing?
end

#length_defined?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'app/models/qe_data_statistic.rb', line 45

def length_defined?
  self.length?
end

#qe_access_statisticQeAccessStatistic



28
# File 'app/models/qe_data_statistic.rb', line 28

has_one :qe_access_statistic

#sqft_defined?Boolean

validates_presence_of :catalog_id, :floor_type_id, :application_type, :heating_system_type_code, :sqft, :coverage_state
validates_format_of :application_type, :with => %r\b[FWSMO]{2\b}
validates_format_of :heating_system_type_code, :with => %r\b[TZEV2SMCH]{2,3\b}
validates_numericality_of :sqft, :greater_than_or_equal_to => 0.0, if: :sqft_defined?
validates_numericality_of :width, :greater_than_or_equal_to => 0.0, if: :width_defined?
validates_numericality_of :length, :greater_than_or_equal_to => 0.0, if: :length_defined?
validates_numericality_of :expansion_joint_spacing, :greater_than_or_equal_to => 0.0, if: :expansion_joint_spacing_defined?

Returns:

  • (Boolean)


37
38
39
# File 'app/models/qe_data_statistic.rb', line 37

def sqft_defined?
  self.sqft?
end

#width_defined?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'app/models/qe_data_statistic.rb', line 41

def width_defined?
  self.width?
end