budget/app/models/income.rb

7 lines
129 B
Ruby

class Income < ApplicationRecord
belongs_to :member
def self.total
Income.where(included: true).sum(&:amount)
end
end