Class: Decidim::TimeTracker::Admin::DestroyTask
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Decidim::TimeTracker::Admin::DestroyTask
- Defined in:
- app/commands/decidim/time_tracker/admin/destroy_task.rb
Overview
A command with all the business logic when updating an task
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(task, user) ⇒ DestroyTask
constructor
Public: Initializes the command.
Constructor Details
#initialize(task, user) ⇒ DestroyTask
Public: Initializes the command.
form - A form object with the params.
11 12 13 14 |
# File 'app/commands/decidim/time_tracker/admin/destroy_task.rb', line 11 def initialize(task, user) @task = task @user = 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.
22 23 24 25 |
# File 'app/commands/decidim/time_tracker/admin/destroy_task.rb', line 22 def call destroy_task! broadcast(:ok) end |