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

@ -1,3 +1,7 @@
class Income < ApplicationRecord
belongs_to :member
def self.total
Income.where(included: true).sum(&:amount)
end
end