Class: Bookkeeping::EquityAccount
- Inherits:
-
Account
- Object
- ActiveRecord::Base
- Account
- Bookkeeping::EquityAccount
show all
- Defined in:
- app/models/bookkeeping/equity_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
.balance ⇒ Object
18
19
20
|
# File 'app/models/bookkeeping/equity_account.rb', line 18
def self.balance
all.select(:id).to_a.sum(&:balance)
end
|
Instance Method Details
#balance ⇒ Object
22
23
24
|
# File 'app/models/bookkeeping/equity_account.rb', line 22
def balance
credits_balance - debits_balance
end
|