Class: Booth::PasswordResets::PropagateToCredential

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

Instance Method Summary collapse

Methods included from MethodObject

included

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/booth/password_resets/propagate_to_credential.rb', line 9

def call
  debug { 'Propagating PasswordReset to Credential...' }
  raise "Expected PasswordReset to be valid: #{password_reset.errors.to_a.to_sentence}" if password_reset.invalid?

  password_reset.transaction do
    update_credential!
    invalidate_password_resets!
    finalize_password_reset!
  end
end