1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 21:45:23 +02:00

Handle market holidays during holding sync (#1292)

* Handle market holidays during holding sync

* Use informal holidays instead of custom override
This commit is contained in:
Zach Gollwitzer 2024-10-10 18:02:12 -04:00 committed by GitHub
parent 77fc5caecf
commit 3399b74849
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 6 deletions

View file

@ -38,13 +38,15 @@ module Security::Price::Provided
if response.success?
response.prices.map do |price|
new_price = Security::Price.new \
new_price = Security::Price.find_or_initialize_by(
ticker: ticker,
date: price[:date],
price: price[:price],
currency: price[:currency]
date: price[:date]
) do |p|
p.price = price[:price]
p.currency = price[:currency]
end
new_price.save! if cache
new_price.save! if cache && new_price.new_record?
new_price
end
else