improves incomplete verification scope [#500]
This commit is contained in:
@@ -6,8 +6,7 @@ module Verification
|
||||
scope :level_two_verified, -> { where("users.confirmed_phone IS NOT NULL AND users.residence_verified_at IS NOT NULL") }
|
||||
scope :level_two_or_three_verified, -> { where("users.verified_at IS NOT NULL OR (users.confirmed_phone IS NOT NULL AND users.residence_verified_at IS NOT NULL)") }
|
||||
scope :unverified, -> { where("users.verified_at IS NULL AND (users.residence_verified_at IS NULL OR users.confirmed_phone IS NULL)") }
|
||||
scope :with_failed_attempts, -> { where("users.failed_census_calls_count > ?", 0) }
|
||||
scope :incomplete_verification, -> { unverified.with_failed_attempts }
|
||||
scope :incomplete_verification, -> { where("(users.residence_verified_at IS NULL AND users.failed_census_calls_count > ?) OR (users.residence_verified_at IS NOT NULL AND (users.unconfirmed_phone IS NULL OR users.confirmed_phone IS NULL))", 0) }
|
||||
end
|
||||
|
||||
def verification_email_sent?
|
||||
|
||||
Reference in New Issue
Block a user