2
0

Add coverage to user spec for missing last_sign_in_at scenario (#35587)

This commit is contained in:
Matt Jankowski
2025-07-30 09:46:58 -04:00
committed by GitHub
parent 139025fce0
commit e8e6cf9510
2 changed files with 16 additions and 6 deletions

View File

@@ -209,10 +209,8 @@ class User < ApplicationRecord
end
def update_sign_in!(new_sign_in: false)
old_current = current_sign_in_at
new_current = Time.now.utc
self.last_sign_in_at = old_current || new_current
self.last_sign_in_at = current_sign_in_at || new_current
self.current_sign_in_at = new_current
increment(:sign_in_count) if new_sign_in