mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-22 06:39:39 +02:00
14 lines
364 B
Ruby
14 lines
364 B
Ruby
|
module Account::CashesHelper
|
||
|
def brokerage_cash(account)
|
||
|
currency = Money::Currency.new(account.currency)
|
||
|
|
||
|
account.holdings.build \
|
||
|
date: Date.current,
|
||
|
qty: account.balance,
|
||
|
price: 1,
|
||
|
amount: account.balance,
|
||
|
currency: account.currency,
|
||
|
security: Security.new(ticker: currency.iso_code, name: currency.name)
|
||
|
end
|
||
|
end
|