Skip to content
Merged
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
3 changes: 1 addition & 2 deletions app/services/funnel/doc_auth/register_submit_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class RegisterSubmitStep
def self.call(doc_auth_log, issuer, token, success)
update_submit_count(doc_auth_log, issuer, token)
update_error_count(doc_auth_log, token, success)
doc_auth_log.save
end

def self.update_submit_count(doc_auth_log, issuer, token)
Expand All @@ -13,15 +14,13 @@ def self.update_submit_count(doc_auth_log, issuer, token)
method = "#{token}_submit_at".to_sym
doc_auth_log[method] = Time.zone.now if doc_auth_log.respond_to?(method)
doc_auth_log.issuer = issuer
doc_auth_log.save
end
private_class_method :update_submit_count

def self.update_error_count(doc_auth_log, token, success)
error_count = "#{token}_error_count".to_sym
return unless doc_auth_log.respond_to?(error_count) && !success
doc_auth_log[error_count] += 1
doc_auth_log.save
end
private_class_method :update_error_count
end
Expand Down