From e83b423fd417c550976b795f810278994729eaa2 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Thu, 27 Aug 2015 23:59:19 +0200 Subject: [PATCH] adds user verification extensions --- app/models/user.rb | 1 + lib/verification.rb | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 lib/verification.rb diff --git a/app/models/user.rb b/app/models/user.rb index 407016ee3..f54c15306 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,5 +1,6 @@ class User < ActiveRecord::Base include ActsAsParanoidAliases + include Verification OMNIAUTH_EMAIL_PREFIX = 'omniauth@participacion' OMNIAUTH_EMAIL_REGEX = /\A#{OMNIAUTH_EMAIL_PREFIX}/ diff --git a/lib/verification.rb b/lib/verification.rb new file mode 100644 index 000000000..2e784d65c --- /dev/null +++ b/lib/verification.rb @@ -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 \ No newline at end of file