logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

preview_card_serializer.rb (397B)


  1. # frozen_string_literal: true
  2. class REST::PreviewCardSerializer < ActiveModel::Serializer
  3. include RoutingHelper
  4. attributes :url, :title, :description, :type,
  5. :author_name, :author_url, :provider_name,
  6. :provider_url, :html, :width, :height,
  7. :image, :embed_url
  8. def image
  9. object.image? ? full_asset_url(object.image.url(:original)) : nil
  10. end
  11. end