Class: Decidim::Admin::PublishFeature
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Decidim::Admin::PublishFeature
- Defined in:
- app/commands/decidim/admin/publish_feature.rb
Overview
This command gets called when a feature is published from the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Public: Publishes the Feature.
-
#initialize(feature, current_user) ⇒ PublishFeature
constructor
Public: Initializes the command.
Constructor Details
#initialize(feature, current_user) ⇒ PublishFeature
Public: Initializes the command.
feature - The feature to publish. current_user - the user performing the action
11 12 13 14 |
# File 'app/commands/decidim/admin/publish_feature.rb', line 11 def initialize(feature, current_user) @feature = feature @current_user = current_user end |
Instance Method Details
#call ⇒ Object
Public: Publishes the Feature.
Broadcasts :ok if published, :invalid otherwise.
19 20 21 22 23 24 |
# File 'app/commands/decidim/admin/publish_feature.rb', line 19 def call publish_feature publish_event broadcast(:ok) end |