1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-25 08:09:38 +02:00

Fix start date missing error in market data sync
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

This commit is contained in:
Zach Gollwitzer 2025-05-16 14:40:52 -04:00
parent 35d1447494
commit b8903d0980

View file

@ -101,14 +101,14 @@ class MarketDataSyncer
def get_first_required_price_date(security)
return default_start_date if snapshot?
Trade.with_entry.where(security: security).minimum(:date)
Trade.with_entry.where(security: security).minimum(:date) || default_start_date
end
# An approximation that grabs more than we likely need, but simplifies the logic
def get_first_required_exchange_rate_date(from_currency:)
return default_start_date if snapshot?
Entry.where(currency: from_currency).minimum(:date)
Entry.where(currency: from_currency).minimum(:date) || default_start_date
end
def default_start_date