diff --git a/app/models/family.rb b/app/models/family.rb index 7ebec1c4f..5f4fdbf87 100644 --- a/app/models/family.rb +++ b/app/models/family.rb @@ -69,10 +69,12 @@ class Family < ApplicationRecord country != "US" && country != "CA" end - def requires_data_provider? + def requires_securities_data_provider? # If family has any trades, they need a provider for historical prices - return true if trades.any? + trades.any? + end + def requires_exchange_rates_data_provider? # If family has any accounts not denominated in the family's currency, they need a provider for historical exchange rates return true if accounts.where.not(currency: self.currency).any? @@ -85,7 +87,8 @@ class Family < ApplicationRecord end def missing_data_provider? - requires_data_provider? && Provider::Registry.get_provider(:synth).nil? + (requires_securities_data_provider? && Security.provider.nil?) || + (requires_exchange_rates_data_provider? && ExchangeRate.provider.nil?) end def oldest_entry_date diff --git a/app/views/accounts/_account_sidebar_tabs.html.erb b/app/views/accounts/_account_sidebar_tabs.html.erb index 8951cc3cd..822b8f2d8 100644 --- a/app/views/accounts/_account_sidebar_tabs.html.erb +++ b/app/views/accounts/_account_sidebar_tabs.html.erb @@ -12,10 +12,10 @@ <%= icon("chevron-down", color: "warning", class: "group-open:transform group-open:rotate-180") %>
Maybe uses Synth API to fetch historical exchange rates, security prices, and more. This data is required to calculate accurate historical account balances.
+Sure uses third party providers to fetch historical exchange rates, security prices, and more. This data is required to calculate accurate historical account balances.
- <%= link_to "Add your Synth API key here.", settings_hosting_path, class: "text-yellow-600 underline" %> + <%= link_to "Configure your providers here.", settings_hosting_path, class: "text-yellow-600 underline" %>