0
0
Fork 0

Add User.unconfirmed scope, reduce factories in scheduler/user_cleanup spec (#31063)

This commit is contained in:
Matt Jankowski 2024-07-25 10:18:24 -04:00 committed by GitHub
parent 34626b8291
commit e881a59671
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 15 deletions

View file

@ -117,6 +117,7 @@ class User < ApplicationRecord
scope :pending, -> { where(approved: false) }
scope :approved, -> { where(approved: true) }
scope :confirmed, -> { where.not(confirmed_at: nil) }
scope :unconfirmed, -> { where(confirmed_at: nil) }
scope :enabled, -> { where(disabled: false) }
scope :disabled, -> { where(disabled: true) }
scope :active, -> { confirmed.signed_in_recently.account_not_suspended }