module Logistics module Core class CustomsTransportTariff < ApplicationRecord belongs_to :route belongs_to :entry_point validates :route, :entry_point, :total_distance, :distance_to_entry_point, :proportion, presence: true validates_uniqueness_of :route, :scope => :entry_point delegate(:name, to: :entry_point, prefix: true) delegate(:route_name, to: :route, prefix: false) end end end