From fd47078b14c89cd9c1e373e16074abc8d83d0e62 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 13 Mar 2019 18:20:08 +0100 Subject: [PATCH 1/1] Provide a helpful warning if there's an application.yml file detected --- config/application.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- 2.45.2