Sha256: 21b69b6a1c8ff8be04464e02aec40878c98f87b8a2ae6bcff7218c71df0246ad
Contents?: true
Size: 424 Bytes
Versions: 24
Compression:
Stored size: 424 Bytes
Contents
module Comee module Core class InvoiceItem < ApplicationRecord before_save { self.total_price = unit_price * quantity } belongs_to :shipment_instruction_item belongs_to :invoice belongs_to :unit validates :quantity, :unit_price, presence: true, numericality: {greater_than: 0} validates :total_price, numericality: {greater_than_or_equal_to: 0, allow_nil: true} end end end
Version data entries
24 entries across 24 versions & 1 rubygems