mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-18 20:59:39 +02:00
Update security price query in demo generator (#2000)
This commit is contained in:
parent
06468a05b1
commit
a7db914005
1 changed files with 1 additions and 1 deletions
|
@ -374,7 +374,7 @@ class Demo::Generator
|
|||
date = Faker::Number.positive(to: 730).days.ago.to_date
|
||||
security = trade[:security]
|
||||
qty = trade[:qty]
|
||||
price = Security::Price.find_by(ticker: security.ticker, date: date)&.price || 1
|
||||
price = Security::Price.find_by(security: security, date: date)&.price || 1
|
||||
name_prefix = qty < 0 ? "Sell " : "Buy "
|
||||
|
||||
account.entries.create! \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue