Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/models/profile.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

class Profile < ApplicationRecord
FACIAL_MATCH_IDV_LEVELS = %w[unsupervised_with_selfie in_person].to_set.freeze

belongs_to :user
# rubocop:disable Rails/InverseOf
belongs_to :initiating_service_provider,
Expand Down Expand Up @@ -310,7 +312,7 @@ def profile_age_in_seconds
end

def facial_match?
::User::FACIAL_MATCH_IDV_LEVELS.include?(idv_level)
FACIAL_MATCH_IDV_LEVELS.include?(idv_level)
end

private
Expand Down
4 changes: 1 addition & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class User < ApplicationRecord
MAX_RECENT_EVENTS = 5
MAX_RECENT_DEVICES = 5

FACIAL_MATCH_IDV_LEVELS = %w[unsupervised_with_selfie in_person].to_set.freeze

enum otp_delivery_preference: { sms: 0, voice: 1 }

# rubocop:disable Rails/HasManyOrHasOneDependent
Expand Down Expand Up @@ -377,7 +375,7 @@ def identity_verified?
end

def identity_verified_with_facial_match?
FACIAL_MATCH_IDV_LEVELS.include?(active_profile&.idv_level)
active_profile.present? && active_profile.facial_match?
end

# This user's most recently activated profile that has also been deactivated
Expand Down