Sha256: e8217ae1e0498d6a05800563d274c9011145d03bcd11921e1a49ce64e1c8a645

Contents?: true

Size: 524 Bytes

Versions: 14

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

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

14 entries across 14 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.1.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.1.1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.1.0 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.5 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.4 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.1.0.rc1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.3 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.1.0.beta app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.0 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.0.rc2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-4.0.0.rc1 app/serializers/alchemy/essence_picture_serializer.rb