Sha256: 875a5b406d497f9dc2bf8be6e912c2ef99bac20e1079525b7f0af7e3bed20424
Contents?: true
Size: 808 Bytes
Versions: 13
Compression:
Stored size: 808 Bytes
Contents
# frozen_string_literal: true # rubocop:disable Style/ClassAndModuleChildren module Maglev::GetPageSections::TransformCollectionItemConcern def transform_collection_item_content_setting(content, setting) # the content might come from the default value of the collection_item setting # rubocop:disable Style/StringHashKeys content['value'] = { 'id' => 'any' } if content&.dig('value') == 'any' # rubocop:enable Style/StringHashKeys item_id = content&.dig('value', 'id') return if item_id.blank? item = fetch_collection_items.call( collection_id: setting.options[:collection_id], id: item_id ) return unless item content['value']['label'] = item.label content['value']['item'] = item.source end end # rubocop:enable Style/ClassAndModuleChildren
Version data entries
13 entries across 13 versions & 1 rubygems