Account for non-activiated accounts

pull/1600/head
Rick Carlino 2019-11-25 15:05:18 -06:00
parent 7be0569a89
commit 76b3f9692e
1 changed files with 9 additions and 0 deletions

View File

@ -56,7 +56,16 @@ class InactiveAccountJob < ApplicationJob
.map(&:deactivate_account)
end
# EDGE CASE: Accounts that register but never sign in.
def cleanup_nils
User
.where(last_sign_in_at: nil)
.limit(LIMIT)
.map { |x| x.update!(last_sign_in_at: x.created_at) }
end
def perform
cleanup_nils
notify_old_accounts
delete_old_accounts
end