Sha256: 09ee8331d0a16c56528ce2e9a6a44f01de6c48720842a04630d2a111838380a8

Contents?: true

Size: 954 Bytes

Versions: 1

Compression:

Stored size: 954 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 skip_index]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pages_core-3.15.5 app/controllers/concerns/pages_core/page_parameters.rb