From a9b72c80958a5fb7903f68271828f54c2bb41842 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 15 Feb 2024 15:33:26 +1100 Subject: [PATCH] Comment on rare upsert usage --- app/models/oidc_account.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/oidc_account.rb b/app/models/oidc_account.rb index 84d6fd4a3f..b755849753 100644 --- a/app/models/oidc_account.rb +++ b/app/models/oidc_account.rb @@ -15,6 +15,8 @@ class OidcAccount < ApplicationRecord token: auth.dig(:credentials, :token), refresh_token: auth.dig(:credentials, :refresh_token), } - upsert_all([attributes], unique_by: [:user_id]) + # This skips validations but we have database constraints in place. + # We may replace this at some point. + upsert_all([attributes], unique_by: [:user_id]) # rubocop:disable Rails/SkipsModelValidations end end