Sha256: 659959801d9b42306a7de6ec06fc9a47d889ab8d89a174af1a2a5aa1cc3bc090

Contents?: true

Size: 804 Bytes

Versions: 9

Compression:

Stored size: 804 Bytes

Contents

module Logistics
  module Core
    class AgencyPermitDocument < ApplicationRecord
      belongs_to :agency
      belongs_to :document_type
      validates :agency_id, :document_type_id, presence: true, allow_blank: false
      validates :agency_id, :uniqueness => {:scope => [:document_type_id]}

      delegate(:code, to: :document_type, prefix: false)
      delegate(:name, to: :document_type, prefix: false)
      delegate(:description, to: :document_type, prefix: false)
      delegate(:document_type_category_id, to: :document_type, prefix: false)
      delegate(:document_type_category_name, to: :document_type, prefix: false)
      delegate(:document_type_origin_id, to: :document_type, prefix: false)
      delegate(:document_type_origin_name, to: :document_type, prefix: false)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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