Sha256: 49669d479c41f6bb72c3063dee9f222a9ef27f22549f6a3e1ac73ab2e151287c
Contents?: true
Size: 871 Bytes
Versions: 32
Compression:
Stored size: 871 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses 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 end
Version data entries
32 entries across 32 versions & 2 rubygems