Files
discourse/app/serializers/upload_serializer.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
558 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2013-02-05 14:16:51 -05:00
class UploadSerializer < ApplicationSerializer
2017-08-22 16:40:01 -04:00
attributes :id,
:url,
:original_filename,
:filesize,
:width,
:height,
:thumbnail_width,
:thumbnail_height,
2017-08-22 16:40:01 -04:00
:extension,
:short_url,
:short_path,
:retain_hours,
:human_filesize
def url
2020-07-03 13:23:10 +02:00
object.for_site_setting ? object.url : UrlHelper.cook_url(object.url, secure: SiteSetting.secure_media? && object.secure)
end
2013-02-05 14:16:51 -05:00
end