Make the test suite pass

This commit is contained in:
Andrew Tomaka 2023-03-07 22:08:02 -05:00
parent bb13e45793
commit fe99fbc9de
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE

View file

@ -1,5 +1,5 @@
class Member < ApplicationRecord class Member < ApplicationRecord
has_many :incomes has_many :incomes, dependent: :destroy
def income def income
incomes.sum(&:amount) incomes.sum(&:amount)
@ -15,6 +15,8 @@ class Member < ApplicationRecord
def burden_percent def burden_percent
((Income.total - others_included_income) / Income.total).round(2) ((Income.total - others_included_income) / Income.total).round(2)
rescue
0
end end
def burden_amount(total_amount: Expense.monthly_total) def burden_amount(total_amount: Expense.monthly_total)