-
-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Description
I followed this but I am unable to access the environment variable with Settings
config.rb
Config.setup do |config|
config.use_env = true
config.env_prefix = 'SETTINGS'
config.env_separator = '__'
config.env_converter = :downcase
config.env_parse_values = true
endSETTINGS__SECTION__SERVER_SIZE=1 SETTINGS__SECTION__SERVER=google.com SETTINGS__SECTION__SSL_ENABLED=false rails cSettings.section.server_size # => nil
Settings.section.server # => nil
Settings.section.ssl_enabled # => nil
# They are accessible this way
ENV['SETTINGS__SECTION__SERVER_SIZE'] #=> "1"
ENV['SETTINGS__SECTION__SERVER'] #=> "google.com"
ENV['SETTINGS__SECTION__SSL_ENABLED'] #=> "false"- ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-darwin20]
- rails (6.1.6)
- config (4.0.0)
Metadata
Metadata
Assignees
Labels
No labels