From bf8c4e0aaf09f0c8a36506369041f316440c7c2f Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Mon, 6 Feb 2023 17:47:54 +0000 Subject: [PATCH] feat: move initial_confirmation_sent update --- app/mailers/devise_notify_mailer.rb | 1 - app/models/user.rb | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/mailers/devise_notify_mailer.rb b/app/mailers/devise_notify_mailer.rb index 827ba9192..827e81b56 100644 --- a/app/mailers/devise_notify_mailer.rb +++ b/app/mailers/devise_notify_mailer.rb @@ -41,7 +41,6 @@ class DeviseNotifyMailer < Devise::Mailer send_confirmation_email(record.unconfirmed_email, record, token, username) end send_confirmation_email(record.email, record, token, username) - record.update!(initial_confirmation_sent: true) end def intercept_send?(email) diff --git a/app/models/user.rb b/app/models/user.rb index a9470a64e..6354086b5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -124,6 +124,7 @@ class User < ApplicationRecord return unless active? super + update!(initial_confirmation_sent: true) end def need_two_factor_authentication?(_request)