mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Account namespace updates: part 5 (valuations) (#901)
* Move Valuation to Account namespace * Move account history to controller * Clean up valuation controller and views * Translations and cleanup * Remove unused scopes and methods * Pass brakeman
This commit is contained in:
parent
0bc0d87768
commit
12380dc8ad
45 changed files with 478 additions and 346 deletions
|
@ -29,6 +29,10 @@ class Account < ApplicationRecord
|
|||
balances.where("date <= ?", date).order(date: :desc).first&.balance
|
||||
end
|
||||
|
||||
def favorable_direction
|
||||
classification == "asset" ? "up" : "down"
|
||||
end
|
||||
|
||||
# e.g. Wise, Revolut accounts that have transactions in multiple currencies
|
||||
def multi_currency?
|
||||
currencies = [ valuations.pluck(:currency), transactions.pluck(:currency) ].flatten.uniq
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue