Sha256: 56b13e5615d7350d386d7ab789c66d2733af1160c009d4d9d63dabbd43e6a42a

Contents?: true

Size: 587 Bytes

Versions: 9

Compression:

Stored size: 587 Bytes

Contents

module Logistics
  module Core
    class ChargeableService < ApplicationRecord
      validates :code, :name, presence: true, uniqueness: true
      validates :order, :chargeable_service_type_id, presence: true
      belongs_to :chargeable_service_type
      belongs_to :transport_service_type, optional: true

      def self.build(options = {})
        ChargeableService.new(options)
      end

      def self.get_chargeable_service_type(cs_id)
        chargeable_service = ChargeableService.find(cs_id)
        chargeable_service.chargeable_service_type.name
      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/chargeable_service.rb
logistics_core-21.11.1 app/models/logistics/core/chargeable_service.rb
logistics_core-21.08.1 app/models/logistics/core/chargeable_service.rb
logistics_core-21.03.1 app/models/logistics/core/chargeable_service.rb
logistics_core-20.10.3 app/models/logistics/core/chargeable_service.rb
logistics_core-20.10.2 app/models/logistics/core/chargeable_service.rb
logistics_core-20.10.1 app/models/logistics/core/chargeable_service.rb
logistics_core-20.9.1 app/models/logistics/core/chargeable_service.rb
logistics_core-20.8.1 app/models/logistics/core/chargeable_service.rb