Add support for provider selection (#346)

This commit is contained in:
soky srm
2025-11-17 18:13:20 +01:00
committed by GitHub
parent 0290ed636f
commit 0d798c522a
8 changed files with 109 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ module Security::Provided
class_methods do
def provider
provider = ENV["SECURITIES_PROVIDER"] || "twelve_data"
provider = ENV["SECURITIES_PROVIDER"].presence || Setting.securities_provider
registry = Provider::Registry.for_concept(:securities)
registry.get_provider(provider.to_sym)
end