Sha256: 7adba11714cd65d1a5522108d395d49127aa333defb72630a34ee947b752b03b

Contents?: true

Size: 795 Bytes

Versions: 8

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module System
    # A command with all the business logic to create the default content blocks
    # for a newly-created organization.
    class CreateDefaultContentBlocks < Decidim::Command
      DEFAULT_CONTENT_BLOCKS =
        [:hero, :sub_hero, :highlighted_content_banner, :how_to_participate, :stats, :metrics, :footer_sub_hero].freeze

      # Public: Initializes the command.
      #
      # form - A form object with the params.
      def initialize(organization)
        @organization = organization
      end

      # Executes the command.
      #
      # Returns nothing.
      def call
        Decidim::ContentBlocksCreator.new(organization).create_default!
      end

      private

      attr_reader :organization
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-system-0.28.5 app/commands/decidim/system/create_default_content_blocks.rb
decidim-system-0.28.4 app/commands/decidim/system/create_default_content_blocks.rb
decidim-system-0.28.3 app/commands/decidim/system/create_default_content_blocks.rb
decidim-system-0.28.2 app/commands/decidim/system/create_default_content_blocks.rb
decidim-system-0.28.1 app/commands/decidim/system/create_default_content_blocks.rb
decidim-system-0.28.0 app/commands/decidim/system/create_default_content_blocks.rb
decidim-system-0.28.0.rc5 app/commands/decidim/system/create_default_content_blocks.rb
decidim-system-0.28.0.rc4 app/commands/decidim/system/create_default_content_blocks.rb