mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Fix trade builder logic
This commit is contained in:
parent
bcb47a9d29
commit
3f48992aea
1 changed files with 8 additions and 3 deletions
|
@ -129,8 +129,13 @@ class TradeBuilder
|
|||
def security
|
||||
ticker_symbol, exchange_operating_mic = ticker.present? ? ticker.split("|") : [ manual_ticker, nil ]
|
||||
|
||||
Security.find_or_create_by(ticker: ticker_symbol, exchange_operating_mic: exchange_operating_mic) do |s|
|
||||
FetchSecurityInfoJob.perform_later(s.id)
|
||||
end
|
||||
security = Security.find_or_create_by!(
|
||||
ticker: ticker_symbol,
|
||||
exchange_operating_mic: exchange_operating_mic
|
||||
)
|
||||
|
||||
FetchSecurityInfoJob.perform_later(security.id)
|
||||
|
||||
security
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue