diff options
author | azul <azul@riseup.net> | 2013-07-17 08:24:09 -0700 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-07-17 08:24:09 -0700 |
commit | 21f39bf368ea1e0deb70eb918f0947fb6fbd900d (patch) | |
tree | c024590754e8c4c1bf1e78cf203c061d68743579 | |
parent | 97bd0ba4b35481216b2a1592065c70562c81c2d5 (diff) | |
parent | 4b9a949b2d481a8d1ab2faa94bb1ba6f75a4edce (diff) |
Merge pull request #63 from azul/bugfix/3201-fix-empty-config-error
Fix breakage due to empty config file for a given env
-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 |