diff options
author | Azul <azul@leap.se> | 2013-07-17 17:08:20 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-07-17 17:08:20 +0200 |
commit | 4b9a949b2d481a8d1ab2faa94bb1ba6f75a4edce (patch) | |
tree | c024590754e8c4c1bf1e78cf203c061d68743579 /config | |
parent | 97bd0ba4b35481216b2a1592065c70562c81c2d5 (diff) |
Fix breakage due to empty config file for a given env
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |