Create estimate on issue close.

This commit is contained in:
ricky committed 2026-03-06 21:42:27 -05:00
1 parent b297657763
commit 47a7447688
4 files changed
+116

No files matched your search

+13
View File
@@ -14,4 +14,17 @@ class LineItem < ApplicationRecord
validates :description, presence: true
validates :quantity, numericality: { greater_than: 0 }
validates :unit_price, numericality: { greater_than_or_equal_to: 0 }
before_save :total
private
def total
log "Updating line total"
self.line_total = self.unit_price * self.quantity
end
def log(msg)
Rails.logger.info "[LineItem] #{msg}"
end
end