Files
nairobi/app/models/verified_user.rb
2015-09-05 22:57:54 +02:00

11 lines
329 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