Class: Decidim::Accountability::Admin::DestroyResult
- Inherits:
-
Command
- Object
- Command
- Decidim::Accountability::Admin::DestroyResult
- Defined in:
- decidim-accountability/app/commands/decidim/accountability/admin/destroy_result.rb
Overview
This command is executed when the user destroys a Result from the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Destroys the result.
-
#initialize(result, current_user) ⇒ DestroyResult
constructor
Initializes an UpdateResult Command.
Constructor Details
#initialize(result, current_user) ⇒ DestroyResult
Initializes an UpdateResult Command.
result - The current instance of the result to be destroyed. current_user - the user performing the action
13 14 15 16 |
# File 'decidim-accountability/app/commands/decidim/accountability/admin/destroy_result.rb', line 13 def initialize(result, current_user) @result = result @current_user = current_user end |
Instance Method Details
#call ⇒ Object
Destroys the result.
Broadcasts :ok if successful, :invalid otherwise.
21 22 23 24 25 |
# File 'decidim-accountability/app/commands/decidim/accountability/admin/destroy_result.rb', line 21 def call destroy_result broadcast(:ok) end |