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

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

Overview

A command that sets a Conference as published.

Instance Method Summary collapse

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
# File '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