2017-08-17 22:00:37 +05:30
|
|
|
class AvatarUploader < GitlabUploader
|
2015-11-26 14:37:03 +05:30
|
|
|
include UploaderHelper
|
2018-03-17 18:26:18 +05:30
|
|
|
include RecordsUploads::Concern
|
2015-11-26 14:37:03 +05:30
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
storage :file
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def exists?
|
|
|
|
model.avatar.file && model.avatar.file.present?
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
2016-08-24 12:49:21 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def move_to_cache
|
|
|
|
false
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
def move_to_store
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
def dynamic_segment
|
|
|
|
File.join(model.class.to_s.underscore, mounted_as.to_s, model.id.to_s)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|