Welcome to mirror list, hosted at ThFree Co, Russian Federation.

avatar_uploader.rb « uploaders « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5c8e1cea62e03fd20943772785727438bc6755b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class AvatarUploader < GitlabUploader
  include UploaderHelper
  include RecordsUploads::Concern

  storage :file

  def exists?
    model.avatar.file && model.avatar.file.present?
  end

  def move_to_cache
    false
  end

  def move_to_store
    false
  end

  private

  def dynamic_segment
    File.join(model.class.to_s.underscore, mounted_as.to_s, model.id.to_s)
  end
end