Calculate burden by member
This commit is contained in:
parent
e098ab48ca
commit
8a7a0cc720
3 changed files with 29 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue