summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-12-20 16:23:10 +0100
committerAzul <azul@leap.se>2012-12-20 16:23:10 +0100
commitc4f87b3447ab2a96dc9181d0b89be4f6f025042a (patch)
treee1dd47e6117e462d429efb270ecafeddc6fba9ea /config/initializers
parentbbfdf2df83c0469b0e4a84b76df072179fe1f0d6 (diff)
parent54037816896a9347c5894ad8260e440bba43d14f (diff)
Merge branch 'feature/use-default-config-file' into feature/validate-email-domain
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/load_config.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/config/initializers/load_config.rb b/config/initializers/load_config.rb
index e687429..a3dbc5f 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).with_indifferent_access