Class: Bookkeeping::LiabilityAccount

Inherits:
Account
  • Object
show all
Defined in:
app/models/bookkeeping/liability_account.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Account

[], balanced?, by_kind, #credits_balance, #debits_balance, #overdraft?, total_balance

Class Method Details

.balanceObject



18
19
20
# File 'app/models/bookkeeping/liability_account.rb', line 18

def self.balance
  all.select(:id).to_a.sum(&:balance)
end

Instance Method Details

#balanceObject



22
23
24
# File 'app/models/bookkeeping/liability_account.rb', line 22

def balance
  credits_balance - debits_balance
end