Sha256: 7f609df30514115ed2737d536b30f7423a040e2016457f8358d998716d1c365c
Contents?: true
Size: 900 Bytes
Versions: 13
Compression:
Stored size: 900 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin module ContentBlocks # A command with all the business logic to destroy a content block class DestroyContentBlock < Decidim::Command # Public: Initializes the command. # # content_block - The content_block to destroy def initialize(content_block) @content_block = content_block end # Executes the command. Broadcasts these events: # # - :ok when everything is valid. # - :invalid if the form was not valid and we could not proceed. # # Returns nothing. def call destroy_content_block broadcast(:ok) rescue StandardError broadcast(:invalid) end private def destroy_content_block @content_block.destroy! end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems