mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00: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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user