module Logistics module Core class KilogramMinimumRateSerializer < ActiveModel::Serializer attributes :id, :service_delivery_unit_id, :service_delivery_unit_name, :chargeable_service_id, :chargeable_service_name, :transaction_type_id, :transaction_type_name, :minimum_price def service_delivery_unit_id object.chargeable_service_unit_of_charge&.service_delivery_unit_id end def service_delivery_unit_name object.chargeable_service_unit_of_charge&.service_delivery_unit.name end def chargeable_service_id object.chargeable_service_unit_of_charge&.chargeable_service_id end def chargeable_service_name object.chargeable_service_unit_of_charge&.chargeable_service.name end end end end