RS IZ if yaml fails to load (empty config) file load the example
This commit is contained in:
parent
74a92a2637
commit
b01928af4b
1 changed files with 6 additions and 0 deletions
|
|
@ -4,6 +4,12 @@
|
|||
|
||||
raw_config = File.read("#{Rails.root}/config/app_config.yml")
|
||||
all_envs = YAML.load(raw_config)
|
||||
|
||||
unless all_envs
|
||||
raw_config = File.read("#{Rails.root}/config/app_config_example.yml")
|
||||
all_envs = YAML.load(raw_config)
|
||||
end
|
||||
|
||||
if all_envs[Rails.env]
|
||||
APP_CONFIG = all_envs['default'].merge(all_envs[Rails.env]).symbolize_keys
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue