Sha256: cb6fd85270998619fd99ed7eed621abad8a53a1258a65d701270539d5d60ea45

Contents?: true

Size: 602 Bytes

Versions: 4

Compression:

Stored size: 602 Bytes

Contents

##
# Shipment Item 是装运项。

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

  self.table_name = 'unidom_shipment_items'

  include Unidom::Common::Concerns::ModelExtension

  validates :quantity, presence: true, numericality: { greater_than_or_equal_to: 0, less_than: 1_000_000_000 }

  belongs_to :shipment, class_name:  'Unidom::Shipment::Shipment'
  belongs_to :shipped,  polymorphic: true

  has_many :package_items, class_name: 'Unidom::Shipment::ShipmentPackageItem'

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
unidom-shipment-0.7.4 app/models/unidom/shipment/shipment_item.rb
unidom-shipment-0.7.3 app/models/unidom/shipment/shipment_item.rb
unidom-shipment-0.7.2 app/models/unidom/shipment/shipment_item.rb
unidom-shipment-0.7.1 app/models/unidom/shipment/shipment_item.rb