From c6f8729b5cfda98eacc881d95ab6950ce3747453 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 25 Jan 2022 10:29:31 +0000 Subject: [PATCH] DEV: Move OAuth2UserInfo deprecation to after_save (#15704) We initialize models as part of the warmup process in production, so this was being logged on every boot. We only want to log if a plugin is actually using the model, so after_save is a safer bet. --- app/models/oauth2_user_info.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/oauth2_user_info.rb b/app/models/oauth2_user_info.rb index f58d82f9614..bf758ee9118 100644 --- a/app/models/oauth2_user_info.rb +++ b/app/models/oauth2_user_info.rb @@ -3,7 +3,7 @@ class Oauth2UserInfo < ActiveRecord::Base belongs_to :user - after_initialize do + before_save do Discourse.deprecate("Oauth2UserInfo is deprecated. Use `ManagedAuthenticator` and `UserAssociatedAccount` instead. For more information, see https://meta.discourse.org/t/106695", drop_from: '2.9.0', output_in_test: true) end end