Sha256: 7f28f585bc42c220208e985c4a41f5f184e0a28e69fa08117819637e9e0e30ed
Contents?: true
Size: 785 Bytes
Versions: 6
Compression:
Stored size: 785 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin # A command that sets a participatory process as unpublished. class UnpublishParticipatoryProcess < Rectify::Command # Public: Initializes the command. # # process - A ParticipatoryProcess that will be unpublished 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.unpublish! broadcast(:ok) end private attr_reader :process end end end
Version data entries
6 entries across 6 versions & 2 rubygems