diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-06-01 09:52:19 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-06-01 16:34:48 +0200 |
commit | 6185d12c183b539ea06ab3550b2c21045d169ca4 (patch) | |
tree | 9a5a8e50f8b0c6c64d69099d0374dc15ace808ee /app/uploaders | |
parent | e61f38d79eb85a7c601bd146d5b8e48a8b4418e5 (diff) | |
download | gitlab-ce-6185d12c183b539ea06ab3550b2c21045d169ca4.tar.gz |
Add missing specs
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/artifact_uploader.rb | 4 | ||||
-rw-r--r-- | app/uploaders/gitlab_uploader.rb | 8 | ||||
-rw-r--r-- | app/uploaders/records_uploads.rb | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/app/uploaders/artifact_uploader.rb b/app/uploaders/artifact_uploader.rb index 668b6b8e048..3bc0408f557 100644 --- a/app/uploaders/artifact_uploader.rb +++ b/app/uploaders/artifact_uploader.rb @@ -7,6 +7,10 @@ class ArtifactUploader < GitlabUploader Gitlab.config.artifacts.path end + def self.artifacts_upload_path + File.join(self.local_artifacts_store, 'tmp/uploads/') + end + def initialize(job, field) @job, @field = job, field end diff --git a/app/uploaders/gitlab_uploader.rb b/app/uploaders/gitlab_uploader.rb index c1d9007dc71..02afddb8c6a 100644 --- a/app/uploaders/gitlab_uploader.rb +++ b/app/uploaders/gitlab_uploader.rb @@ -9,15 +9,11 @@ class GitlabUploader < CarrierWave::Uploader::Base delegate :base_dir, to: :class - def local_file? - local_storage? && file&.is_a?(CarrierWave::SanitizedFile) - end - - def local_storage? + def file_storage? storage.is_a?(CarrierWave::Storage::File) end - def local_cache_storage? + def file_cache_storage? cache_storage.is_a?(CarrierWave::Storage::File) end diff --git a/app/uploaders/records_uploads.rb b/app/uploaders/records_uploads.rb index be3a2caa60c..4c127f29250 100644 --- a/app/uploaders/records_uploads.rb +++ b/app/uploaders/records_uploads.rb @@ -16,7 +16,7 @@ module RecordsUploads # # Called `after :store` def record_upload(_tempfile) - return unless local_file? + return unless file_storage? return unless file.exists? Upload.record(self) @@ -26,7 +26,7 @@ module RecordsUploads # # Called `before :remove` def destroy_upload(*args) - return unless local_file? + return unless file_storage? return unless file Upload.remove_path(relative_path) |