diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-02-24 00:54:25 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-02-25 00:41:27 +0300 |
commit | a8c62dfe5c01ed08f170c1d41a39d5167b09631b (patch) | |
tree | 9c25e207356ebc7b2b88f3c0a7cd0e9374f571c8 /app/uploaders/attachment_uploader.rb | |
parent | 1f8d6c790a8493a341f1786710aac36621e93bf6 (diff) |
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/attachment_uploader.rb')
-rw-r--r-- | app/uploaders/attachment_uploader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index cfcb877cc3e..6aa1f5a8c50 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -4,6 +4,6 @@ class AttachmentUploader < 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 end |