1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 23:59:40 +02:00

Handle missing weekend stock prices in sync process (#1242)

* Don't append missing prices if already known

* Add failing test

* Handle weekend stock prices

* Fix tests and gapfill logic
This commit is contained in:
Zach Gollwitzer 2024-10-04 14:19:45 -04:00 committed by GitHub
parent e8d7ee3270
commit 24d3c0243f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 80 additions and 7 deletions

View file

@ -3,11 +3,11 @@ class Issue::PricesMissing < Issue
after_initialize :initialize_missing_prices
validates :missing_prices, presence: true
validates :missing_prices, presence: true, allow_blank: true
def append_missing_price(ticker, date)
missing_prices[ticker] ||= []
missing_prices[ticker] << date
missing_prices[ticker] << date unless missing_prices[ticker].include?(date.to_s)
end
def stale?