Class: Decidim::Conferences::Admin::PublishConference

Inherits:
Admin::ParticipatorySpace::Publish show all
Defined in:
decidim-conferences/app/commands/decidim/conferences/admin/publish_conference.rb

Overview

A command that sets a Conference as published.

Instance Method Summary collapse

Methods inherited from Admin::ParticipatorySpace::Publish

#initialize

Methods inherited from Decidim::Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events

Constructor Details

This class inherits a constructor from Decidim::Admin::ParticipatorySpace::Publish

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
# File 'decidim-conferences/app/commands/decidim/conferences/admin/publish_conference.rb', line 8

def call
  return broadcast(:invalid) if participatory_space.nil? || participatory_space.published?

  Decidim.traceability.perform_action!(:publish, participatory_space, user, **default_options) do
    participatory_space.publish!
  end

  send_notification
  broadcast(:ok, participatory_space)
end