Sha256: f489b1233651e497e7522c80c3ff21063f6db70ca4c535f74a50aa6e7cbfc7c5

Contents?: true

Size: 480 Bytes

Versions: 63

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Pages
    # Command that gets called whenever a component's page has to be created. It
    # usually happens as a callback when the component itself is created.
    class CreatePage < Rectify::Command
      def initialize(component)
        @component = component
      end

      def call
        @page = Page.new(component: @component)

        @page.save ? broadcast(:ok) : broadcast(:invalid)
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
decidim-pages-0.23.6 app/commands/decidim/pages/create_page.rb
decidim-pages-0.24.2 app/commands/decidim/pages/create_page.rb
decidim-pages-0.23.5 app/commands/decidim/pages/create_page.rb
decidim-pages-0.24.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.24.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.24.0.rc2 app/commands/decidim/pages/create_page.rb
decidim-pages-0.23.4 app/commands/decidim/pages/create_page.rb
decidim-pages-0.24.0.rc1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.23.3 app/commands/decidim/pages/create_page.rb
decidim-pages-0.23.2 app/commands/decidim/pages/create_page.rb
decidim-pages-0.23.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.23.1.rc1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.23.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.22.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.21.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.20.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.20.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.19.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.18.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.19.0 app/commands/decidim/pages/create_page.rb