diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-09-11 18:26:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 18:26:59 -0400 |
commit | 21b32bb2a8001240e3e2c42811e2777d0411837d (patch) | |
tree | 1a7df57490790d8cc2e9de7d3bbf3d1b9138c5b1 /railties/lib | |
parent | f589e20b0a865a7efd93e65b2887f0e4ab9a556f (diff) | |
parent | b167d521ab873112ff1b98520f184d8088feb754 (diff) | |
download | rails-21b32bb2a8001240e3e2c42811e2777d0411837d.tar.gz rails-21b32bb2a8001240e3e2c42811e2777d0411837d.tar.bz2 rails-21b32bb2a8001240e3e2c42811e2777d0411837d.zip |
Merge pull request #33815 from mberlanda/mberlanda/enhance-config-for
Use ActiveSupport::InheritableOptions and deep_symbolize_keys in config_for
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 99e42ebefb..26ed195dcc 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -232,7 +232,10 @@ module Rails if yaml.exist? require "erb" - (YAML.load(ERB.new(yaml.read).result) || {})[env] || {} + require "active_support/ordered_options" + + config = (YAML.load(ERB.new(yaml.read).result) || {})[env] || {} + ActiveSupport::InheritableOptions.new(config.deep_symbolize_keys) else raise "Could not load configuration. No such file - #{yaml}" end |