Class: PickedFile
Instance Method Summary
collapse
#fileupload_destroy, #retrieve, #type_name, #upload, #uri, #url, #x_accel_url
Methods inherited from Asset
find_klass, #uri, #x_accel_url
Instance Method Details
#as_json(options = nil) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'app/models/media/picked_file.rb', line 18
def as_json(options = nil)
options = {
root: false,
only: [:id, :guid, :assetable_id, :assetable_type, :user_id, :public_token],
methods: [:filename, :url, :thumb_url, :size, :content_type, :remote_token]
}.merge(options || {})
super(options)
end
|
#delete ⇒ Object
10
11
12
|
# File 'app/models/media/picked_file.rb', line 10
def delete
nil
end
|
#remote_token ⇒ Object
14
15
16
|
# File 'app/models/media/picked_file.rb', line 14
def remote_token
data.try(:file).try(:public_token)
end
|
#remoteupload_klass ⇒ Object
31
32
33
|
# File 'app/models/media/picked_file.rb', line 31
def remoteupload_klass
TranslationCms::Api::Materials::Attachment
end
|
#thumb_url ⇒ Object
8
|
# File 'app/models/media/picked_file.rb', line 8
def thumb_url; end
|
#to_fileupload ⇒ Object
27
28
29
|
# File 'app/models/media/picked_file.rb', line 27
def to_fileupload
as_json
end
|