From 05b6dbec1e5b4d1cb5bf6514f0d81279b530457e Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 8 Sep 2025 15:04:38 +0100 Subject: [PATCH] CLDC-4044: Reset last_sign_at fields on reactivation this is to ensure that the code considers them a fresh user specifically, ensures that the "Resend invite link" button will show --- app/models/user.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index b504db9bc..dfbc8ed79 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -167,6 +167,11 @@ class User < ApplicationRecord update!( active: true, reactivate_with_organisation: false, + # resetting these fields ensures that the 'resend confirmation instructions' button shows + # we have this button be based on sign in date than confirmation status to ensure that the + # user has successfully completed the entire login flow before we hide the button + last_sign_in_at: nil, + last_sign_in_ip: nil, ) end