Sha256: 9d63e4c8fbced0db006125c941de8543185889d1483363e017a814beed33fc51

Contents?: true

Size: 479 Bytes

Versions: 87

Compression:

Stored size: 479 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  class EssencePictureSerializer < ActiveModel::Serializer
    attributes(
      :id,
      :picture_id,
      :caption,
      :title,
      :alt_tag,
      :css_class,
      :link,
    )

    has_one :picture

    def link
      return if object.link.blank?

      {
        url: object.link,
        css_class: object.link_class_name,
        title: object.link_title,
        target: object.link_target,
      }
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.9 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.8 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.7 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.6 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.5 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.14 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.4 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.13 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.3 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.1.0 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.12 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.11 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.10 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.3.8 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.9 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.3.7 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.8 app/serializers/alchemy/essence_picture_serializer.rb