From b167d521ab873112ff1b98520f184d8088feb754 Mon Sep 17 00:00:00 2001 From: Mauro Berlanda Date: Tue, 11 Sep 2018 23:47:41 +0200 Subject: refacto: config_for with ActiveSupport::InheritableOptions and symbolized keys --- railties/lib/rails/application.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'railties/lib') 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 -- cgit v1.2.3