Skip to content

Allow symbol value via ENV #286

Description

@khoan

Setup

cd /path/to/rails/app/src
cat config/initializers/config.rb
Config.setup do |config|
  config.const_name = 'Settings'
  config.use_env = true
  config.env_prefix = 'SETTINGS'
  config.env_separator = '__'
  config.env_converter = :downcase
  config.env_parse_values = true
end
cat config/settings/test.yml
provider: :bam
SETTINGS__PROVIDER=:bam RAILS_ENV=test bin/rails c
Settings.provider # => ":bam"   want symbol instead of string
RAILS_ENV=test bin/rails c
Settings.provider # => :bam  got symbol as expected

maybe related to issue#194? Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions