Sha256: cb0eb6b27244c2e4db987c87138b74dfd0e2945f2570133784435e0b00d16b20

Contents?: true

Size: 440 Bytes

Versions: 12

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  class AttachmentSerializer < ActiveModel::Serializer
    attributes :id,
      :name,
      :file_name,
      :file_mime_type,
      :file_size,
      :icon_css_class,
      :tag_list,
      :created_at,
      :updated_at

    attribute :url do
      Alchemy::Engine.routes.url_helpers.download_attachment_path(
        id: object.id,
        name: object.file_name
      )
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
alchemy_cms-7.3.4 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.3.3 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.3.2 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.2.7 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.3.1 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.3.0 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.2.6 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.2.5 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.2.4 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.2.3 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.2.2 app/serializers/alchemy/attachment_serializer.rb
alchemy_cms-7.2.1 app/serializers/alchemy/attachment_serializer.rb