Class: WithAccounts::PasswordsCreating::UpdateAccount

Inherits:
LetsDoThis::Act
  • Object
show all
Includes:
ErrorsHelpers
Defined in:
app/scenarios/with_accounts/passwords_creating/update_account.rb

Instance Method Summary collapse

Methods included from ErrorsHelpers

#error_key, #format_errors

Instance Method Details

#instructions(stage) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/scenarios/with_accounts/passwords_creating/update_account.rb', line 6

def instructions(stage)
   = stage.

  .tap do
    .password = stage.password
    .password_confirmation = stage.password
    .password_set_invitation = ''
    .password_set_at = Time.now
  end

  unless .save
    errors.add(error_key, 'err')
    return NOTHING_NEW
  end

  { account:  }
rescue StandardError
  errors.add(error_key, 'err')
  NOTHING_NEW
end