1
0
Fork 0
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:
Zach Gollwitzer 2024-02-29 16:35:54 -05:00 committed by GitHub
parent dbf575c02a
commit 14641d16de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 368 additions and 62 deletions

View file

@ -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?