mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 12:34:12 +00:00
feat: Add Twelve Data provider for exchange rates and securities (#2)
* feat: Add Twelve Data provider for exchange rates and securities * test: fix hosting controller test, linting * fix: add countries gem to handle country codes in Twelve Data provider * fix: allow security search combobox to have no logo * refactor: update Twelve Data provider use time series endpoint * fix: set twelve data as default provider
This commit is contained in:
@@ -3,8 +3,9 @@ module ExchangeRate::Provided
|
||||
|
||||
class_methods do
|
||||
def provider
|
||||
provider = ENV["EXCHANGE_RATE_PROVIDER"] || "twelve_data"
|
||||
registry = Provider::Registry.for_concept(:exchange_rates)
|
||||
registry.get_provider(:synth)
|
||||
registry.get_provider(provider.to_sym)
|
||||
end
|
||||
|
||||
def find_or_fetch_rate(from:, to:, date: Date.current, cache: true)
|
||||
|
||||
Reference in New Issue
Block a user