gitlab-org--gitlab-foss/app/uploaders/avatar_uploader.rb

25 lines
380 B
Ruby
Raw Normal View History

2016-08-18 10:31:44 -04:00
class AvatarUploader < GitlabUploader
include UploaderHelper
2018-01-29 12:57:34 -05:00
include RecordsUploads::Concern
2015-02-20 09:19:50 -05:00
storage :file
def exists?
model.avatar.file && model.avatar.file.present?
end
2017-01-02 06:35:15 -05:00
2018-01-29 12:57:34 -05:00
def move_to_cache
2017-01-02 06:35:15 -05:00
false
end
2018-01-29 12:57:34 -05:00
def move_to_store
2017-01-02 06:35:15 -05:00
false
end
2018-01-29 12:57:34 -05:00
private
def dynamic_segment
File.join(model.class.to_s.underscore, mounted_as.to_s, model.id.to_s)
end
2015-02-20 09:19:50 -05:00
end