Sha256: 4f023f98097eb98ed968d5e51a7850336d13ff8a4fdbc21ecedb8fcfa1753f34
Contents?: true
Size: 862 Bytes
Versions: 32
Compression:
Stored size: 862 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses module Admin # A command that sets a participatory process as published. class PublishParticipatoryProcess < Rectify::Command # Public: Initializes the command. # # process - A ParticipatoryProcess that will be published def initialize(process) @process = process end # Executes the command. Broadcasts these events: # # - :ok when everything is valid. # - :invalid if the data wasn't valid and we couldn't proceed. # # Returns nothing. def call return broadcast(:invalid) if process.nil? || process.published? process.publish! broadcast(:ok) end private attr_reader :process end end end end
Version data entries
32 entries across 32 versions & 2 rubygems