Sha256: 74938dcb563ad1c8e9d0278b760068069fb08ad28441175d6be4c602c4994fcc

Contents?: true

Size: 493 Bytes

Versions: 22

Compression:

Stored size: 493 Bytes

Contents

module Alchemy
  class EssencePictureSerializer < ActiveModel::Serializer
    self.root = false

    attributes :id,
      :picture_id,
      :caption,
      :title,
      :alt_tag,
      :css_class,
      :link,
      :created_at,
      :updated_at

    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

22 entries across 22 versions & 1 rubygems

Version Path
alchemy_cms-3.6.7 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.6.6 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.6.5 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.6.4 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.6.3 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.6.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.6.1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.0.beta app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.6.0 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.5.0 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.4.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.5.0.rc2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.5.0.rc1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.4.1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.3.3 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.3.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.4.0 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.4.0.rc1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.3.1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.3.0 app/serializers/alchemy/essence_picture_serializer.rb