Sha256: a9706d7415714f0adad10d553a5f2d5bb1043af68e72702f22ddc6d2e6ae5122

Contents?: true

Size: 488 Bytes

Versions: 2

Compression:

Stored size: 488 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 }

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

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

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-shipment-0.6.1 app/models/unidom/shipment/shipment_item.rb
unidom-shipment-0.6 app/models/unidom/shipment/shipment_item.rb