diff options
| author | Azul <azul@leap.se> | 2013-02-09 13:05:09 +0100 |
|---|---|---|
| committer | Azul <azul@leap.se> | 2013-02-09 13:05:09 +0100 |
| commit | f885f2312b3e3fa8f5e5c926699769416309d1f2 (patch) | |
| tree | 3ec390225f6985010ce4f862345515c1e01892a0 | |
| parent | b82803f40074b581f3ed67ce44c73a42f10daf1a (diff) | |
fall back to {} if config file is empty for environment
| -rw-r--r-- | config/initializers/load_config.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/config/initializers/load_config.rb b/config/initializers/load_config.rb index a3dbc5f..b2b0318 100644 --- a/config/initializers/load_config.rb +++ b/config/initializers/load_config.rb @@ -2,6 +2,6 @@ def load_config_file(file) File.exists?(file) ? YAML.load_file(file)[Rails.env] : {} end -defaults = load_config_file("#{Rails.root}/config/defaults.yml") -config = load_config_file("#{Rails.root}/config/config.yml") +defaults = load_config_file("#{Rails.root}/config/defaults.yml") || {} +config = load_config_file("#{Rails.root}/config/config.yml") || {} APP_CONFIG = defaults.merge(config).with_indifferent_access |
