The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

25 lines
432 B

  1. # frozen_string_literal: true
  2. class REST::MediaAttachmentSerializer < ActiveModel::Serializer
  3. include RoutingHelper
  4. attributes :id, :type, :url, :preview_url,
  5. :remote_url, :text_url, :meta
  6. def url
  7. full_asset_url(object.file.url(:original))
  8. end
  9. def preview_url
  10. full_asset_url(object.file.url(:small))
  11. end
  12. def text_url
  13. medium_url(object.id)
  14. end
  15. def meta
  16. object.file.meta
  17. end
  18. end