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