Sha256: 6dac5f2d27c26d167446f1ea64f78a26e8006dbe3fbfbf874d70aab676c1a151

Contents?: true

Size: 491 Bytes

Versions: 3

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This command deals with destroying a component from the admin panel.
    class DestroyComponent < Decidim::Commands::DestroyResource
      private

      def run_before_hooks
        Decidim::Reminder.where(component: resource).destroy_all
        resource.manifest.run_hooks(:before_destroy, resource)
      end

      def run_after_hooks
        resource.manifest.run_hooks(:destroy, resource)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-admin-0.29.2 app/commands/decidim/admin/destroy_component.rb
decidim-admin-0.29.1 app/commands/decidim/admin/destroy_component.rb
decidim-admin-0.29.0 app/commands/decidim/admin/destroy_component.rb