Class: Decidim::Admin::DestroyStaticPageTopic
- Inherits:
-
Command
- Object
- Command
- Decidim::Admin::DestroyStaticPageTopic
- Defined in:
- decidim-admin/app/commands/decidim/admin/destroy_static_page_topic.rb
Overview
This command deals with destroying a StaticPageTopic from the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Public: Executes the command.
-
#initialize(_topic, current_user) ⇒ DestroyStaticPageTopic
constructor
Public: Initializes the command.
Constructor Details
#initialize(_topic, current_user) ⇒ DestroyStaticPageTopic
Public: Initializes the command.
page - The StaticPageTopic to be destroyed.
10 11 12 13 |
# File 'decidim-admin/app/commands/decidim/admin/destroy_static_page_topic.rb', line 10 def initialize(_topic, current_user) @topic = page @current_user = current_user end |
Instance Method Details
#call ⇒ Object
Public: Executes the command.
Broadcasts :ok if it got destroyed
18 19 20 21 |
# File 'decidim-admin/app/commands/decidim/admin/destroy_static_page_topic.rb', line 18 def call destroy_topic broadcast(:ok) end |