1080351437
d22e522179
55f9b8129a
1
2
3
4
class Invoice < ActiveRecord::Base has_many :line_items, autosave: true before_save { |record| record.balance = record.line_items.map(&:amount).sum } end