diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-02-23 16:54:25 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-02-24 16:41:27 -0500 |
commit | a8c62dfe5c01ed08f170c1d41a39d5167b09631b (patch) | |
tree | 9c25e207356ebc7b2b88f3c0a7cd0e9374f571c8 /app/uploaders/avatar_uploader.rb | |
parent | 1f8d6c790a8493a341f1786710aac36621e93bf6 (diff) | |
download | gitlab-ce-a8c62dfe5c01ed08f170c1d41a39d5167b09631b.tar.gz |
Minor refactoring of Uploaders
- Moves a duplicate `file_storage?` definition into the common
`GitlabUploader` ancestor.
- Get the `uploads` base directory from a class method rather than
hard-coding it where it's needed. This will be used in a subsequent MR
to store Uploads in the database.
- Improves the specs for uploaders.
Diffstat (limited to 'app/uploaders/avatar_uploader.rb')
-rw-r--r-- | app/uploaders/avatar_uploader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/uploaders/avatar_uploader.rb b/app/uploaders/avatar_uploader.rb index 265cea2d2c6..b4c393c6f2c 100644 --- a/app/uploaders/avatar_uploader.rb +++ b/app/uploaders/avatar_uploader.rb @@ -4,7 +4,7 @@ class AvatarUploader < GitlabUploader storage :file def store_dir - "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" + "#{base_dir}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end def exists? |