Sha256: 3a4b872645dbece85443d19b129a1e0a7d57a1e3e5ee2378d7d3dea9880d3a70

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

##
# Shipment 是装运。

class Unidom::Shipment::Shipment < Unidom::Shipment::ApplicationRecord

  self.table_name = 'unidom_shipments'

  include Unidom::Common::Concerns::ModelExtension
  include ProgneTapera::EnumCode

  validates :estimated_amount, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }
  validates :actual_amount,    presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1_000_000_000 }

  belongs_to :sender_party,    polymorphic: true
  belongs_to :sender_agent,    polymorphic: true
  belongs_to :sender_location, polymorphic: true
  belongs_to :sender_contact,  polymorphic: true

  belongs_to :receiver_party,    polymorphic: true
  belongs_to :receiver_agent,    polymorphic: true
  belongs_to :receiver_location, polymorphic: true
  belongs_to :receiver_contact,  polymorphic: true

  has_many :items, class_name: 'Unidom::Shipment::ShipmentItem'

  code :conveyance, Unidom::Shipment::Conveyance

end unless Unidom::Common::Neglection.namespace_neglected? 'Unidom::Shipment::Shipment'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
unidom-shipment-1.0 app/models/unidom/shipment/shipment.rb
unidom-shipment-0.7.8 app/models/unidom/shipment/shipment.rb
unidom-shipment-0.7.7 app/models/unidom/shipment/shipment.rb
unidom-shipment-0.7.6 app/models/unidom/shipment/shipment.rb
unidom-shipment-0.7.5 app/models/unidom/shipment/shipment.rb