Class: Decidim::Kids::System::CreateMinorsDefaultPages

Inherits:
System::CreateDefaultPages
  • Object
show all
Defined in:
app/commands/concerns/decidim/kids/system/create_minors_default_pages.rb

Instance Method Summary collapse

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
# File 'app/commands/concerns/decidim/kids/system/create_minors_default_pages.rb', line 7

def call
  Decidim::StaticPage::MINORS_DEFAULT_PAGES.map do |slug|
    Decidim::StaticPage.find_or_create_by!(organization: organization, slug: slug) do |page|
      page.title = localized_attribute(slug, :title)
      page.content = localized_attribute(slug, :content)
      page.show_in_footer = false
      page.allow_public_access = true
    end
  end
end