Sha256: 2a57c1c97c33cd4614cc0e47898642c1f8f4b4cde53188ac9134f5b31d3e61c5

Contents?: true

Size: 452 Bytes

Versions: 30

Compression:

Stored size: 452 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Pages
    # Command that gets called when the page of this component needs to be
    # destroyed. It usually happens as a callback when the component is removed.
    class DestroyPage < Decidim::Command
      def initialize(component)
        @component = component
      end

      def call
        Page.where(component: @component).destroy_all
        broadcast(:ok)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
decidim-pages-0.30.0.rc3 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.30.0.rc2 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.30.0.rc1 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.29.2 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.28.5 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.29.1 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.28.4 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.27.9 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.29.0 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.28.3 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.27.8 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.29.0.rc4 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.29.0.rc3 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.29.0.rc2 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.29.0.rc1 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.28.2 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.27.7 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.28.1 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.27.6 app/commands/decidim/pages/destroy_page.rb
decidim-pages-0.28.0 app/commands/decidim/pages/destroy_page.rb