Class: Decidim::ParticipatoryProcesses::Admin::DestroyParticipatoryProcessType
- Inherits:
-
Command
- Object
- Command
- Decidim::ParticipatoryProcesses::Admin::DestroyParticipatoryProcessType
- Defined in:
- decidim-participatory_processes/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_type.rb
Overview
A command with all the business logic when destroying a participatory process type in the system.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(participatory_process_type, current_user) ⇒ DestroyParticipatoryProcessType
constructor
Public: Initializes the command.
Constructor Details
#initialize(participatory_process_type, current_user) ⇒ DestroyParticipatoryProcessType
Public: Initializes the command.
participatory_process_type - A participatory_process_type object to destroy current_user - the user performing the action
14 15 16 17 |
# File 'decidim-participatory_processes/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_type.rb', line 14 def initialize(participatory_process_type, current_user) @participatory_process_type = participatory_process_type @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.
25 26 27 28 29 |
# File 'decidim-participatory_processes/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_type.rb', line 25 def call destroy_participatory_process_type! broadcast(:ok) end |