mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 13:09:55 +08:00
26 lines
440 B
Ruby
26 lines
440 B
Ruby
![]() |
# frozen_string_literal: true
|
||
|
|
||
|
class UserExportSerializer < ApplicationSerializer
|
||
|
attributes :id, :filename, :uri, :filesize, :extension, :retain_hours, :human_filesize
|
||
|
|
||
|
def filename
|
||
|
object.upload.original_filename
|
||
|
end
|
||
|
|
||
|
def uri
|
||
|
object.upload.short_path
|
||
|
end
|
||
|
|
||
|
def filesize
|
||
|
object.upload.filesize
|
||
|
end
|
||
|
|
||
|
def extension
|
||
|
object.upload.extension
|
||
|
end
|
||
|
|
||
|
def human_filesize
|
||
|
object.upload.human_filesize
|
||
|
end
|
||
|
end
|