Sha256: 5050650fc86799f983e9ca262c274c6c2a382cf6d45b770e643b3bbc0b7fec06

Contents?: true

Size: 943 Bytes

Versions: 4

Compression:

Stored size: 943 Bytes

Contents

# frozen_string_literal: true

module PagesCore
  module PageParameters
    extend ActiveSupport::Concern

    def page_attachment_attributes
      { page_images_attributes: %i[id position image_id primary _destroy],
        page_files_attributes: %i[id position attachment_id _destroy] }
    end

    def page_content_attributes
      locales = PagesCore.config.locales&.keys || [I18n.default_locale]
      [page_static_attributes,
       PagesCore::Templates::TemplateConfiguration.all_blocks,
       :path_segment,
       (PagesCore::Templates::TemplateConfiguration
                  .localized_blocks + %i[path_segment])
         .index_with { locales },
       page_attachment_attributes]
    end

    def page_static_attributes
      %i[template user_id status feed_enabled published_at redirect_to
         news_page unique_name pinned parent_page_id serialized_tags
         meta_image_id starts_at ends_at all_day]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pages_core-3.15.4 app/controllers/concerns/pages_core/page_parameters.rb
pages_core-3.15.3 app/controllers/concerns/pages_core/page_parameters.rb
pages_core-3.15.2 app/controllers/concerns/pages_core/page_parameters.rb
pages_core-3.15.1 app/controllers/concerns/pages_core/page_parameters.rb