diff options
Diffstat (limited to 'config/initializers/load_config.rb')
-rw-r--r-- | config/initializers/load_config.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config/initializers/load_config.rb b/config/initializers/load_config.rb index e687429..6cfde12 100644 --- a/config/initializers/load_config.rb +++ b/config/initializers/load_config.rb @@ -1 +1,7 @@ -APP_CONFIG = YAML.load_file("#{Rails.root}/config/config.yml")[Rails.env] +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") +APP_CONFIG = defaults.merge(config) |