Sha256: 06dc528fba9ff8d6aa29b0de39ff1905429a6a10774fe1da36b9a424b6609694

Contents?: true

Size: 1.21 KB

Versions: 43

Compression:

Stored size: 1.21 KB

Contents

# Collection Item Component
# ================
#
# V3
# -----
#
# {
#   searchable_caption: "",
#   media_type: "image",
#   image: {
#     id: undefined,
#     name: ""
#   },
#   video: {
#     url: "https://vimeo.com/115082758"
#   }
# }
#

module Promethee::StructureUpgrader::Components
  class CollectionItem < Base
    def upgraded_attributes
      {
        'caption' => {
          'searchable' => true,
          'translatable' => true,
          'type' => 'text',
          'value' => attribute('searchable_caption')
        },
        'media_type' => {
          'collection' => [
            { 'label' => 'Image', 'value' => 'image' },
            { 'label' => 'Video', 'value' => 'video' }
          ],
          'searchable' => false,
          'translatable' => false,
          'type' => 'enum',
          'value' => attribute('media_type')
        },
        'image' => {
          'searchable' => false,
          'translatable' => false,
          'type' => 'blob',
          'value' => attribute('image')
        },
        'video' => {
          'searchable' => false,
          'translatable' => true,
          'type' => 'video',
          'value' => attribute('video', 'url')
        }
      }
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
promethee-5.1.1 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-5.1.0 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-5.0.2 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-5.0.1 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-5.0.0 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.28 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.27 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.26 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.25 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.24 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.23 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.22 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.21 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.20 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.19 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.18 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.17 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.16 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.15 app/services/promethee/structure_upgrader/components/collection_item.rb
promethee-4.1.14 app/services/promethee/structure_upgrader/components/collection_item.rb