Sha256: 0958eb06e1ce9e9d332fb59a04a997121f72ff812a5188195b48449b99ca2d26
Contents?: true
Size: 899 Bytes
Versions: 19
Compression:
Stored size: 899 Bytes
Contents
module Comee module Core class ShipmentInstructionItem < ApplicationRecord before_save :set_details, if: proc { |item| item.details.empty? } belongs_to :shipment_instruction belongs_to :shipment_item belongs_to :unit belongs_to :pod, optional: true belongs_to :delivery_note, optional: true validates :pallet_no, presence: true validates :length, :width, :height, :weight, :quantity, :price, presence: true, numericality: {greater_than: 0} def set_details self.details = { customer_item_no: shipment_item.sales_order_item.customer_item_no, customer_item_description: shipment_item.sales_order_item.customer_item_description, customer_item_alias: shipment_item.sales_order_item.customer_item_alias, use_alias: shipment_item.sales_order_item.use_alias } end end end end
Version data entries
19 entries across 19 versions & 1 rubygems