Sha256: e8bb873d850c50f1f1f6b0fe8fba0497b8c5a5f0d21898f50a7174807fe0653f
Contents?: true
Size: 822 Bytes
Versions: 32
Compression:
Stored size: 822 Bytes
Contents
# frozen_string_literal: true module Decidim module Assemblies module Admin # A command that sets an assembly as published. class PublishAssembly < Rectify::Command # Public: Initializes the command. # # assembly - A Assembly that will be published def initialize(assembly) @assembly = assembly 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 assembly.nil? || assembly.published? assembly.publish! broadcast(:ok) end private attr_reader :assembly end end end end
Version data entries
32 entries across 32 versions & 2 rubygems