summaryrefslogtreecommitdiff
path: root/app/uploaders/uploader_helper.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-02-23 16:54:25 -0500
committerRobert Speicher <rspeicher@gmail.com>2017-02-24 16:41:27 -0500
commita8c62dfe5c01ed08f170c1d41a39d5167b09631b (patch)
tree9c25e207356ebc7b2b88f3c0a7cd0e9374f571c8 /app/uploaders/uploader_helper.rb
parent1f8d6c790a8493a341f1786710aac36621e93bf6 (diff)
downloadgitlab-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/uploader_helper.rb')
-rw-r--r--app/uploaders/uploader_helper.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/uploaders/uploader_helper.rb b/app/uploaders/uploader_helper.rb
index bee311583ea..7635c20ab3a 100644
--- a/app/uploaders/uploader_helper.rb
+++ b/app/uploaders/uploader_helper.rb
@@ -27,6 +27,8 @@ module UploaderHelper
extension_match?(DANGEROUS_EXT)
end
+ private
+
def extension_match?(extensions)
return false unless file
@@ -40,8 +42,4 @@ module UploaderHelper
extensions.include?(extension.downcase)
end
-
- def file_storage?
- self.class.storage == CarrierWave::Storage::File
- end
end