mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Add Local Development Demo Data (#502)
* Clean up seeds, add development demo data * Handle liability account display and sync * Fix tests
This commit is contained in:
parent
dbf575c02a
commit
14641d16de
12 changed files with 368 additions and 62 deletions
|
@ -12,6 +12,21 @@ class Account < ApplicationRecord
|
|||
delegate :type_name, to: :accountable
|
||||
before_create :check_currency
|
||||
|
||||
def classification
|
||||
classifications = {
|
||||
"Account::Depository" => :asset,
|
||||
"Account::Investment" => :asset,
|
||||
"Account::Property" => :asset,
|
||||
"Account::Vehicle" => :asset,
|
||||
"Account::OtherAsset" => :asset,
|
||||
"Account::Loan" => :liability,
|
||||
"Account::Credit" => :liability,
|
||||
"Account::OtherLiability" => :liability
|
||||
}
|
||||
|
||||
classifications[accountable_type]
|
||||
end
|
||||
|
||||
def balance_series(period)
|
||||
filtered_balances = balances.in_period(period).order(:date)
|
||||
return nil if filtered_balances.empty?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue