Class: Decidim::AccessRequests::Verification::Admin::ConfirmUserAccessRequest
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Decidim::AccessRequests::Verification::Admin::ConfirmUserAccessRequest
- Defined in:
- app/commands/decidim/access_requests/verification/admin/confirm_user_access_request.rb
Overview
A command to confirm a previous partial authorization. This is just a wrapper class to call the ConfirmUserAuthorization command because we add the email notifications here.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(authorization, form) ⇒ ConfirmUserAccessRequest
constructor
Public: Initializes the command.
Constructor Details
#initialize(authorization, form) ⇒ ConfirmUserAccessRequest
Public: Initializes the command.
authorization - An Authorization to be confirmed. form - A form object with the verification data to confirm it.
15 16 17 18 |
# File 'app/commands/decidim/access_requests/verification/admin/confirm_user_access_request.rb', line 15 def initialize(, form) @authorization = @form = form end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if the handler wasn’t valid and we couldn’t proceed.
Returns nothing.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/commands/decidim/access_requests/verification/admin/confirm_user_access_request.rb', line 26 def call parent = self Decidim::Verifications::ConfirmUserAuthorization.call(, form) do on(:ok) do send_notification parent.send(:broadcast, :ok) end on(:invalid) do parent.send(:broadcast, :invalid) end on(:already_confirmed) do parent.send(:broadcast, :invalid) end end end |