Sha256: e11c85f8dcac729f95b1550a73abc70bb6d0158921961ca3b9bb117181515f60
Contents?: true
Size: 858 Bytes
Versions: 20
Compression:
Stored size: 858 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin # This command deals with destroying a StaticPage from the admin panel. class DestroyStaticPage < Decidim::Command # Public: Initializes the command. # # page - The StaticPage to be destroyed. def initialize(page, current_user) @page = page @current_user = current_user end # Public: Executes the command. # # Broadcasts :ok if it got destroyed def call destroy_page broadcast(:ok) end private attr_reader :page, :current_user def destroy_page transaction do Decidim.traceability.perform_action!( "delete", page, current_user ) do page.destroy! end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems