Fix workhorse temp path for namespace uploads

This commit is contained in:
Jarka Košanová 2018-09-10 19:03:33 +02:00
parent 2054199b47
commit 8440435214
3 changed files with 15 additions and 0 deletions

View file

@ -21,6 +21,10 @@ class NamespaceFileUploader < FileUploader
File.join(model.id.to_s)
end
def self.workhorse_local_upload_path
File.join(options.storage_path, 'uploads', TMP_UPLOAD_PATH)
end
# Re-Override
def store_dir
store_dirs[object_store]

View file

@ -0,0 +1,5 @@
---
title: Fix workhorse temp path for namespace uploads
merge_request: 21650
author:
type: fixed

View file

@ -40,6 +40,12 @@ describe NamespaceFileUploader do
end
end
describe '#workhorse_local_upload_path' do
it 'returns the correct path in uploads directory' do
expect(described_class.workhorse_local_upload_path).to end_with('/uploads/tmp/uploads')
end
end
describe "#migrate!" do
before do
uploader.store!(fixture_file_upload(File.join('spec/fixtures/doc_sample.txt')))