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-5.0.10 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.0.pre.rc5 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.0.pre.rc4 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.0.pre.rc3 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.2.5 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.1.9 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.0.9 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.2.4 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.1.8 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.0.8 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.0.7 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.1.7 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.2.3 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.0.pre.rc2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.1.6 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.0.6 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.2.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.1.5 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-5.0.5 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-6.0.0.pre.rc1 app/serializers/alchemy/essence_picture_serializer.rb