gab-social/app/serializers/rest/preview_card_serializer.rb
mgabdev f129d9c49b Added LinkTimeline and PreviewCard fetching by id
• Added:
- LinkTimeline and PreviewCard fetching by id
2020-10-29 18:46:54 -05:00

15 lines
402 B
Ruby

# frozen_string_literal: true
class REST::PreviewCardSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :id, :url, :title, :description, :type,
:author_name, :author_url, :provider_name,
:provider_url, :html, :width, :height,
:image, :embed_url
def image
object.image? ? full_asset_url(object.image.url(:original)) : nil
end
end