Class: Logistics::Core::BroadGaugeCnt

Inherits:
ApplicationRecord show all
Defined in:
app/models/logistics/core/broad_gauge_cnt.rb

Class Method Summary collapse

Methods inherited from ApplicationRecord

as_json

Class Method Details

.fetch_allObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/logistics/core/broad_gauge_cnt.rb', line 10

def self.fetch_all
  result = []
  broad_gauges = BroadGaugeCnt.all
  broad_gauges.each do |broad_gauge|
    result.push({id: broad_gauge.id,
                 container_size_id: broad_gauge.container_size_id,
                 container_size_name: broad_gauge.container_size.name,
                 container_type_id: broad_gauge.container_type_id,
                 container_type_name: broad_gauge.container_type.name,
                 length: broad_gauge.length,
                 width: broad_gauge.width,
                 height: broad_gauge.height,
                 actual_weight: broad_gauge.actual_weight})
  end
  return result
end