diff options
author | Mauro Berlanda <mauro.berlanda@gmail.com> | 2018-09-11 23:47:41 +0200 |
---|---|---|
committer | Mauro Berlanda <mauro.berlanda@gmail.com> | 2018-09-11 23:47:41 +0200 |
commit | b167d521ab873112ff1b98520f184d8088feb754 (patch) | |
tree | b0bd9df4be86e9bae55d329a00a48598da56931e /railties/lib/rails | |
parent | 2a470d73a75ebf8cd7975e469bd82586d9234442 (diff) | |
download | rails-b167d521ab873112ff1b98520f184d8088feb754.tar.gz rails-b167d521ab873112ff1b98520f184d8088feb754.tar.bz2 rails-b167d521ab873112ff1b98520f184d8088feb754.zip |
refacto: config_for with ActiveSupport::InheritableOptions and symbolized keys
Diffstat (limited to 'railties/lib/rails')
-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 |