Sha256: 1ec9e190429dd9be40167bdba47eaed59bdf48b530cf2438d087434980f07de8

Contents?: true

Size: 689 Bytes

Versions: 9

Compression:

Stored size: 689 Bytes

Contents

module Logistics
  module Core
    class TruckTypeAssignment < ApplicationRecord
      validates :truck_type, presence: true, allow_blank: false

      belongs_to :container_size

      has_many :truck_type_cnt_weight_ranges

      def self.fetch_all
        result = []
        TruckTypeAssignment.all.each do |truck_type_assignment|
          result.push({id: truck_type_assignment.id,
                       container_size_id: truck_type_assignment.container_size_id,
                       container_size_name: truck_type_assignment.container_size.name,
                       truck_type: truck_type_assignment.truck_type})
        end
        return result
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logistics_core-21.11.2 app/models/logistics/core/truck_type_assignment.rb
logistics_core-21.11.1 app/models/logistics/core/truck_type_assignment.rb
logistics_core-21.08.1 app/models/logistics/core/truck_type_assignment.rb
logistics_core-21.03.1 app/models/logistics/core/truck_type_assignment.rb
logistics_core-20.10.3 app/models/logistics/core/truck_type_assignment.rb
logistics_core-20.10.2 app/models/logistics/core/truck_type_assignment.rb
logistics_core-20.10.1 app/models/logistics/core/truck_type_assignment.rb
logistics_core-20.9.1 app/models/logistics/core/truck_type_assignment.rb
logistics_core-20.8.1 app/models/logistics/core/truck_type_assignment.rb