Class: Decidim::Votings::Admin::DestroyPollingOfficer
- Inherits:
-
Command
- Object
- Command
- Decidim::Votings::Admin::DestroyPollingOfficer
- Defined in:
- app/commands/decidim/votings/admin/destroy_polling_officer.rb
Overview
A command with the business logic to destroy a poling officer
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(polling_officer, current_user) ⇒ DestroyPollingOfficer
constructor
Public: Initializes the command.
Constructor Details
#initialize(polling_officer, current_user) ⇒ DestroyPollingOfficer
Public: Initializes the command.
polling_officer - the PollingOfficer to destroy current_user - the user performing this action
12 13 14 15 |
# File 'app/commands/decidim/votings/admin/destroy_polling_officer.rb', line 12 def initialize(polling_officer, current_user) @polling_officer = polling_officer @current_user = current_user end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if the form was not valid and we could not proceed.
Returns nothing.
23 24 25 26 |
# File 'app/commands/decidim/votings/admin/destroy_polling_officer.rb', line 23 def call destroy_polling_officer! broadcast(:ok) end |