Make the test suite pass
This commit is contained in:
parent
bb13e45793
commit
fe99fbc9de
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
class Member < ApplicationRecord
|
||||
has_many :incomes
|
||||
has_many :incomes, dependent: :destroy
|
||||
|
||||
def income
|
||||
incomes.sum(&:amount)
|
||||
|
@ -15,6 +15,8 @@ class Member < ApplicationRecord
|
|||
|
||||
def burden_percent
|
||||
((Income.total - others_included_income) / Income.total).round(2)
|
||||
rescue
|
||||
0
|
||||
end
|
||||
|
||||
def burden_amount(total_amount: Expense.monthly_total)
|
||||
|
|
Loading…
Reference in a new issue