Class: Decidim::Solutions::Admin::DestroySolution
- Inherits:
-
Command
- Object
- Command
- Decidim::Solutions::Admin::DestroySolution
- Defined in:
- app/commands/decidim/solutions/admin/destroy_solution.rb
Overview
This command deals with destroying a Solution from the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Public: Executes the command.
-
#initialize(solution, current_user) ⇒ DestroySolution
constructor
Public: Initializes the command.
Constructor Details
#initialize(solution, current_user) ⇒ DestroySolution
Public: Initializes the command.
page - The Solution to be destroyed.
11 12 13 14 15 |
# File 'app/commands/decidim/solutions/admin/destroy_solution.rb', line 11 def initialize(solution, current_user) super() @solution = solution @current_user = current_user end |
Instance Method Details
#call ⇒ Object
Public: Executes the command.
Broadcasts :ok if it got destroyed
20 21 22 23 |
# File 'app/commands/decidim/solutions/admin/destroy_solution.rb', line 20 def call destroy_solution broadcast(:ok) end |