Sha256: 55139e9d4aa33e97ca5aa48840f6cc6a3f8572b62b470bfe0b64189842a20ab7
Contents?: true
Size: 541 Bytes
Versions: 17
Compression:
Stored size: 541 Bytes
Contents
module Dorsale module BillingMachine class QuotationLine < ActiveRecord::Base self.table_name = "dorsale_billing_machine_quotation_lines" belongs_to :quotation, inverse_of: :lines default_scope -> { order(:created_at => :asc) } before_save :update_total def update_total self.quantity ||= 0 self.unit_price ||= 0 self.total = self.quantity * self.unit_price end # ??? after_save do self.quotation.reload.save end end end end
Version data entries
17 entries across 17 versions & 1 rubygems