From: Andy Allan Date: Wed, 13 Mar 2019 17:20:08 +0000 (+0100) Subject: Provide a helpful warning if there's an application.yml file detected X-Git-Tag: live~3199^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/fd47078b14c89cd9c1e373e16074abc8d83d0e62 Provide a helpful warning if there's an application.yml file detected --- diff --git a/config/application.rb b/config/application.rb index 2a0547a72..d521b4a9c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,5 +1,18 @@ require_relative "boot" +# Guard against deployments with old-style application.yml configurations +# Otherwise, admins might not be aware that they are now silently ignored +# and major problems could occur +# rubocop:disable Rails/Output, Rails/Exit +if File.exist?(File.expand_path("application.yml", __dir__)) + puts "The config/application.yml file is no longer supported" + puts "Default settings are now found in config/settings.yml and you can override these in config/settings.local.yml" + puts "To prevent unexpected behaviour, please copy any custom settings to config/settings.local.yml" + puts " and then remove your config/application.yml file." + exit! +end +# rubocop:enable Rails/Output, Rails/Exit + # Set the STATUS constant from the environment, if it matches a recognized value ALLOWED_STATUS = [ :online, # online and operating normally