Module: Maglev::SectionsConcern

Included in:
Page, Site
Defined in:
app/models/concerns/maglev/sections_concern.rb

Overview

rubocop:disable Style/ClassAndModuleChildren

Instance Method Summary collapse

Instance Method Details

#prepare_sectionsObject



5
6
7
8
9
10
11
12
# File 'app/models/concerns/maglev/sections_concern.rb', line 5

def prepare_sections
  # NOTE: pages defined in the theme definition
  # don't include the ids for sections/blocks
  self.sections ||= [] # NOTE: the self is mandatory here
  sections.each do |section|
    prepare_section(section)
  end
end

#prepare_sections_translationsObject



14
15
16
17
18
19
20
21
22
# File 'app/models/concerns/maglev/sections_concern.rb', line 14

def prepare_sections_translations
  return if sections_translations.blank?

  sections_translations.each_key do |locale|
    Maglev::I18n.with_locale(locale) do
      prepare_sections
    end
  end
end