From 3faadacc154d15079edb42c26bb621dea907e248 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Thu, 4 Feb 2016 13:38:56 +0100 Subject: [PATCH] differentiates between level 2 and level 3 users --- app/models/concerns/verification.rb | 2 +- app/views/account/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/verification.rb b/app/models/concerns/verification.rb index 2f644158a..01d660012 100644 --- a/app/models/concerns/verification.rb +++ b/app/models/concerns/verification.rb @@ -3,7 +3,7 @@ module Verification included do scope :level_three_verified, -> { where.not(verified_at: nil) } - scope :level_two_verified, -> { where("users.level_two_verified_at IS NOT NULL OR (users.confirmed_phone IS NOT NULL AND users.residence_verified_at IS NOT NULL)") } + scope :level_two_verified, -> { where("users.level_two_verified_at IS NOT NULL OR (users.confirmed_phone IS NOT NULL AND users.residence_verified_at IS NOT NULL) AND verified_at IS NULL") } scope :level_two_or_three_verified, -> { where("users.verified_at IS NOT NULL OR users.level_two_verified_at IS NOT NULL OR (users.confirmed_phone IS NOT NULL AND users.residence_verified_at IS NOT NULL)") } scope :unverified, -> { where("users.verified_at IS NULL AND (users.level_two_verified_at IS NULL AND (users.residence_verified_at IS NULL OR users.confirmed_phone IS NULL))") } scope :incomplete_verification, -> { where("(users.residence_verified_at IS NULL AND users.failed_census_calls_count > ?) OR (users.residence_verified_at IS NOT NULL AND (users.unconfirmed_phone IS NULL OR users.confirmed_phone IS NULL))", 0) } diff --git a/app/views/account/show.html.erb b/app/views/account/show.html.erb index 9397b79f9..6c0242329 100644 --- a/app/views/account/show.html.erb +++ b/app/views/account/show.html.erb @@ -73,7 +73,7 @@
  •  <%= t("account.show.user_permission_debates") %>
  •  <%= t("account.show.user_permission_proposal") %>
  • - <% if current_user.level_two_verified? || current_user.level_three_verified? %> + <% if current_user.level_two_or_three_verified? %> <% else %>