Class: WithAccounts::LoginInvitationsCreating::FindAndCheckAccount
- Inherits:
-
LetsDoThis::Act
- Object
- LetsDoThis::Act
- WithAccounts::LoginInvitationsCreating::FindAndCheckAccount
show all
- Includes:
- ErrorsHelpers
- Defined in:
- app/scenarios/with_accounts/login_invitations_creating/find_and_check_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
|
# File 'app/scenarios/with_accounts/login_invitations_creating/find_and_check_account.rb', line 6
def instructions(stage)
account = Account.ready_to_login(:_)
.joins(:user)
.where('users.disabled': false, 'users.email': stage.email)
.take&.authenticate(stage.password)
unless account
errors.add(error_key, 'err')
return NOTHING_NEW
end
{ account: account }
end
|