Class: Decidim::Solutions::Admin::DestroySolution

Inherits:
Command
  • Object
show all
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

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

#callObject

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