Sha256: dbda0448c39be90db1c230270bc78145e321dab543993f0971398730d0fa5318

Contents?: true

Size: 494 Bytes

Versions: 27

Compression:

Stored size: 494 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

27 entries across 27 versions & 2 rubygems

Version Path
alchemy_cms-3.0.2 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.0.1 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.0.0 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.0.0.rc8 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.0.0.rc7 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.0.0.rc6 app/serializers/alchemy/essence_picture_serializer.rb
alchemy_cms-3.0.0.rc5 app/serializers/alchemy/essence_picture_serializer.rb