Class: WithAccounts::PasswordsCreating::UpdateAccount
- Inherits:
-
LetsDoThis::Act
- Object
- LetsDoThis::Act
- WithAccounts::PasswordsCreating::UpdateAccount
show all
- Includes:
- ErrorsHelpers
- Defined in:
- app/scenarios/with_accounts/passwords_creating/update_account.rb
Instance Method Summary
collapse
#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)
account = stage.account
account.tap do
account.password = stage.password
account.password_confirmation = stage.password
account.password_set_invitation = ''
account.password_set_at = Time.now
end
unless account.save
errors.add(error_key, 'err')
return NOTHING_NEW
end
{ account: account }
rescue StandardError
errors.add(error_key, 'err')
NOTHING_NEW
end
|