diff options
author | Simon Eskildsen <sirup@sirupsen.com> | 2015-10-30 18:46:15 +0000 |
---|---|---|
committer | Simon Eskildsen <sirup@sirupsen.com> | 2015-10-30 18:57:54 +0000 |
commit | e58c96766f5264be7fb8a4bdfd9a40ef177fb057 (patch) | |
tree | 3770e26ef77dd7906dbd87165479e1323dd4d926 /railties/lib | |
parent | cb848c8dd716b0243e41a94c9b52c803a3056eb4 (diff) | |
download | rails-e58c96766f5264be7fb8a4bdfd9a40ef177fb057.tar.gz rails-e58c96766f5264be7fb8a4bdfd9a40ef177fb057.tar.bz2 rails-e58c96766f5264be7fb8a4bdfd9a40ef177fb057.zip |
rails/application: allow passing an env to config_for
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index e81ec62a1d..77efe3248d 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -218,12 +218,12 @@ module Rails # Rails.application.configure do # config.middleware.use ExceptionNotifier, config_for(:exception_notification) # end - def config_for(name) + def config_for(name, env: Rails.env) yaml = Pathname.new("#{paths["config"].existent.first}/#{name}.yml") if yaml.exist? require "erb" - (YAML.load(ERB.new(yaml.read).result) || {})[Rails.env] || {} + (YAML.load(ERB.new(yaml.read).result) || {})[env] || {} else raise "Could not load configuration. No such file - #{yaml}" end |