11 lines
326 B
Ruby
11 lines
326 B
Ruby
class VerifiedUser < ActiveRecord::Base
|
|
scope :by_user, ->(user) { where(document_number: user.document_number) }
|
|
|
|
scope :by_email, ->(email) { where(email: email) }
|
|
scope :by_phone, ->(phone) { where(phone: phone) }
|
|
|
|
def self.phone?(user)
|
|
by_user(user).by_phone(user.unconfirmed_phone).first.present?
|
|
end
|
|
end
|