From 4b9a949b2d481a8d1ab2faa94bb1ba6f75a4edce Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 17 Jul 2013 17:08:20 +0200 Subject: Fix breakage due to empty config file for a given env --- config/application.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/application.rb b/config/application.rb index ec25da5..354127b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,7 +17,11 @@ end APP_CONFIG = ["defaults.yml", "config.yml"].inject({}) {|config, file| filepath = File.expand_path(file, File.dirname(__FILE__)) - config.merge(File.exists?(filepath) ? YAML.load_file(filepath)[Rails.env] : {}) + if File.exists?(filepath) && settings = YAML.load_file(filepath)[Rails.env] + config.merge(settings) + else + config + end }.with_indifferent_access module LeapWeb -- cgit v1.2.3