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
This commit is contained in:
parent
35d1447494
commit
b8903d0980
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue