Class: Booth::Onboardings::PropagateToCredential

Inherits:
Object
  • Object
show all
Includes:
Logging, MethodObject
Defined in:
lib/booth/onboardings/propagate_to_credential.rb

Instance Method Summary collapse

Methods included from MethodObject

included

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/booth/onboardings/propagate_to_credential.rb', line 11

def call
  debug { 'Propagating Onboarding to Credential...' }
  raise "Expected Onboarding to be valid: #{onboarding.errors.full_messages.to_sentence}" if onboarding.invalid?

  onboarding.transaction do
    update_credential!
    remove_existing_authenticators!
    create_authenticator!
    register_audit!
    finalize_onboarding!
  end
  debug { 'Propagation of Onboarding completed' }
end