Sha256: 6585db8a15bb2b80a5ad58499a15c0547f56ea0ecf70d2366064d13c6798edc9
Contents?: true
Size: 879 Bytes
Versions: 46
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 < Rectify::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
46 entries across 46 versions & 1 rubygems