Class: Decidim::System::CreateDefaultContentBlocks

Inherits:
Command
  • Object
show all
Defined in:
app/commands/decidim/system/create_default_content_blocks.rb

Overview

A command with all the business logic to create the default content blocks for a newly-created organization.

Constant Summary collapse

DEFAULT_CONTENT_BLOCKS =
[:hero, :sub_hero, :highlighted_content_banner, :how_to_participate, :stats, :metrics, :footer_sub_hero].freeze

Instance Method Summary collapse

Constructor Details

#initialize(organization) ⇒ CreateDefaultContentBlocks

Public: Initializes the command.

form - A form object with the params.



14
15
16
# File 'app/commands/decidim/system/create_default_content_blocks.rb', line 14

def initialize(organization)
  @organization = organization
end

Instance Method Details

#callObject

Executes the command.

Returns nothing.



21
22
23
# File 'app/commands/decidim/system/create_default_content_blocks.rb', line 21

def call
  Decidim::ContentBlocksCreator.new(organization).create_default!
end