Class: Decidim::Budgets::Admin::DestroyProject
- Inherits:
-
Command
- Object
- Command
- Decidim::Budgets::Admin::DestroyProject
- Defined in:
- decidim-budgets/app/commands/decidim/budgets/admin/destroy_project.rb
Overview
This command is executed when the user deletes a Project from the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Performs the action.
-
#initialize(project, current_user) ⇒ DestroyProject
constructor
Initializes an UpdateProject Command.
Constructor Details
#initialize(project, current_user) ⇒ DestroyProject
Initializes an UpdateProject Command.
project - The current instance of the project to be destroyed. current_user - the user that performs the action
13 14 15 16 |
# File 'decidim-budgets/app/commands/decidim/budgets/admin/destroy_project.rb', line 13 def initialize(project, current_user) @project = project @current_user = current_user end |
Instance Method Details
#call ⇒ Object
Performs the action.
Broadcasts :ok if successful, :invalid otherwise.
21 22 23 24 |
# File 'decidim-budgets/app/commands/decidim/budgets/admin/destroy_project.rb', line 21 def call destroy_project broadcast(:ok) end |