Files
grecia/app/models/verified_user.rb
taitus 151b12bd35 Remove unused by_email scope from VerifiedUser
The "by_email" scope in VerifiedUser is no longer used anywhere in the
code. Its last occurrence was removed in commit 76daee1fb0 ("removes
unmasked emails and phones in forms").
2025-11-14 13:44:12 +01:00

9 lines
271 B
Ruby

class VerifiedUser < ApplicationRecord
scope :by_user, ->(user) { where(document_number: user.document_number) }
scope :by_phone, ->(phone) { where(phone: phone) }
def self.phone?(user)
by_user(user).by_phone(user.unconfirmed_phone).first.present?
end
end