Class: Decidim::ParticipatoryProcesses::Admin::DestroyParticipatoryProcessAdmin
- Inherits:
-
Command
- Object
- Command
- Decidim::ParticipatoryProcesses::Admin::DestroyParticipatoryProcessAdmin
- Defined in:
- decidim-participatory_processes/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_admin.rb
Overview
A command with all the business logic when destroying a participatory process admin in the system.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(role, current_user) ⇒ DestroyParticipatoryProcessAdmin
constructor
Public: Initializes the command.
Constructor Details
#initialize(role, current_user) ⇒ DestroyParticipatoryProcessAdmin
Public: Initializes the command.
role - the ParticipatoryProcessUserRole to destroy current_user - the user performing this action
13 14 15 16 |
# File 'decidim-participatory_processes/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_admin.rb', line 13 def initialize(role, current_user) @role = role @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 wasn't valid and we couldn't proceed.
Returns nothing.
24 25 26 27 |
# File 'decidim-participatory_processes/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_admin.rb', line 24 def call destroy_role! broadcast(:ok) end |