My Notes

Signout Users

rails devise

Code to logout deactivated users:

if current_user&.deactivated_at
  email = current_user.email
  sign_out current_user
  redirect_to root_path, alert: "Your account has been deactivated. Account: #{email} "
end