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