adds user verification extensions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class User < ActiveRecord::Base
|
||||
include ActsAsParanoidAliases
|
||||
include Verification
|
||||
|
||||
OMNIAUTH_EMAIL_PREFIX = 'omniauth@participacion'
|
||||
OMNIAUTH_EMAIL_REGEX = /\A#{OMNIAUTH_EMAIL_PREFIX}/
|
||||
|
||||
20
lib/verification.rb
Normal file
20
lib/verification.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
module Verification
|
||||
|
||||
def residence_verified?
|
||||
residence_verified_at.present?
|
||||
end
|
||||
|
||||
def sms_verified?
|
||||
confirmed_phone.present?
|
||||
end
|
||||
|
||||
def level_two_verified?
|
||||
residence_verified? && sms_verified?
|
||||
end
|
||||
|
||||
def level_three_verified?
|
||||
verified_at.present?
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user