闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
385 B

  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
  8. def image
  9. object.image? ? full_asset_url(object.image.url(:original)) : nil
  10. end
  11. end