Sha256: 6fd6b531c6e383cd8e8c0fceb1860d46f7a69d3588d68af0a14649351b984197

Contents?: true

Size: 466 Bytes

Versions: 56

Compression:

Stored size: 466 Bytes

Contents

# frozen_string_literal: true

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

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

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

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
decidim-pages-0.10.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.10.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.9.3 app/commands/decidim/pages/create_page.rb
decidim-pages-0.9.2 app/commands/decidim/pages/create_page.rb
decidim-pages-0.9.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.9.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.8.4 app/commands/decidim/pages/create_page.rb
decidim-pages-0.8.3 app/commands/decidim/pages/create_page.rb
decidim-pages-0.8.2 app/commands/decidim/pages/create_page.rb
decidim-pages-0.8.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.8.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.7.4 app/commands/decidim/pages/create_page.rb
decidim-pages-0.7.3 app/commands/decidim/pages/create_page.rb
decidim-pages-0.7.2 app/commands/decidim/pages/create_page.rb
decidim-pages-0.7.1 app/commands/decidim/pages/create_page.rb
decidim-pages-0.7.0 app/commands/decidim/pages/create_page.rb
decidim-pages-0.6.8 app/commands/decidim/pages/create_page.rb
decidim-0.6.8 decidim-pages/app/commands/decidim/pages/create_page.rb
decidim-pages-0.6.7 app/commands/decidim/pages/create_page.rb
decidim-0.6.7 decidim-pages/app/commands/decidim/pages/create_page.rb