From ce62da1f88584447eebd6cd31e9813a0dc66cac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 15 Apr 2024 00:32:38 +0200 Subject: [PATCH] Silence deprecation warnings in secrets We were getting a ton of deprecation warnings: ``` DEPRECATION WARNING: `Rails.application.secrets` is deprecated in favor of `Rails.application.credentials` and will be removed in Rails 7.2 ``` However, we don't plan to replace the secrets with credentials in the foreseeable future because it would affect existing Consul Democracy installations, so for now we're simply silencing the warnings. --- config/application.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/application.rb b/config/application.rb index f082b8bc2..055ff57ff 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,6 +21,14 @@ Bundler.require(*Rails.groups) module Consul class Application < Rails::Application + def secrets + Rails.deprecator.silence { super } + end + + def secret_key_base + Rails.deprecator.silence { super } + end + config.load_defaults 7.0 # Keep belongs_to fields optional by default, because that's the way