Class: Decidim::Templates::Admin::DestroyTemplate
- Inherits:
-
Command
- Object
- Command
- Decidim::Templates::Admin::DestroyTemplate
- Defined in:
- app/commands/decidim/templates/admin/destroy_template.rb
Overview
This command deals with destroying a template from the admin panel.
Direct Known Subclasses
Instance Method Summary collapse
-
#call ⇒ Object
Public: Executes the command.
-
#initialize(template, current_user) ⇒ DestroyTemplate
constructor
Public: Initializes the command.
Constructor Details
#initialize(template, current_user) ⇒ DestroyTemplate
Public: Initializes the command.
template - The Template to be destroyed. user - The user that destroys the template.
12 13 14 15 |
# File 'app/commands/decidim/templates/admin/destroy_template.rb', line 12 def initialize(template, current_user) @template = template @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/templates/admin/destroy_template.rb', line 20 def call destroy_template broadcast(:ok) end |