Calculate burden by member

This commit is contained in:
Andrew Tomaka 2022-11-20 16:21:28 -05:00
parent e098ab48ca
commit 8a7a0cc720
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
3 changed files with 29 additions and 0 deletions

View file

@ -10,4 +10,8 @@ class Expense < ApplicationRecord
def monthly
payment * PERIOD_OCCURENCES[period.to_sym] / 12
end
def self.total
Expense.sum(&:payment)
end
end