X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3ba5aa15ea0156a4fce63dcb43b7f972b4c760df..a4127e018442e1b8053307f376c2d8c66b3279fc:/apps/workbench/config/load_config.rb diff --git a/apps/workbench/config/load_config.rb b/apps/workbench/config/load_config.rb index 51fc81ab75..95f6edc952 100644 --- a/apps/workbench/config/load_config.rb +++ b/apps/workbench/config/load_config.rb @@ -7,7 +7,7 @@ $application_config = {} path = "#{::Rails.root.to_s}/config/#{cfgfile}.yml" if File.exists? path yaml = ERB.new(IO.read path).result(binding) - confs = YAML.load(yaml) + confs = YAML.load(yaml, deserialize_symbols: true) $application_config.merge!(confs['common'] || {}) $application_config.merge!(confs[::Rails.env.to_s] || {}) end @@ -23,11 +23,17 @@ ArvadosWorkbench::Application.configure do ks.each do |kk| cfg = cfg.send(kk) end - if cfg.respond_to?(k.to_sym) and !cfg.send(k).nil? - # Config must have been set already in environments/*.rb. + if v.nil? and cfg.respond_to?(k) and !cfg.send(k).nil? + # Config is nil in *.yml, but has been set already in + # environments/*.rb (or has a Rails default). Don't overwrite + # the default/upstream config with nil. # # After config files have been migrated, this mechanism should - # be deprecated, then removed. + # be removed. + Rails.logger.warn <