Sha256: 77bf96d1f032afe9944bf41152a33e241fef9f496cffbb3cca87bbda09fedb3c
Contents?: true
Size: 776 Bytes
Versions: 6
Compression:
Stored size: 776 Bytes
Contents
# frozen_string_literal: true module Decidim 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
Version data entries
6 entries across 6 versions & 2 rubygems