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