summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorJarka Košanová <jarka@gitlab.com>2018-10-29 10:05:47 +0100
committerJarka Košanová <jarka@gitlab.com>2018-11-12 08:57:25 +0100
commit4af1712d01efb7295cc069dca0045b01c7b4cb40 (patch)
treed32a325b8d7e0a7ee00e032e8927e4ba9af9c29d /app/uploaders
parent2e690c8208e9da5e7152e77cd77efdade5260be1 (diff)
downloadgitlab-ce-4af1712d01efb7295cc069dca0045b01c7b4cb40.tar.gz
Extract code from Issues::MoveServicece-3777-promote-to-epic
Extract code to make it easier reusable - introduce AttributesRewriter and ContentRewriter - support group entites when rewriting content - make Uploader copy_to working for Namespaces
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/file_uploader.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb
index ffc1e5f75ca..e90599f2505 100644
--- a/app/uploaders/file_uploader.rb
+++ b/app/uploaders/file_uploader.rb
@@ -149,9 +149,9 @@ class FileUploader < GitlabUploader
# return a new uploader with a file copy on another project
def self.copy_to(uploader, to_project)
- moved = uploader.dup.tap do |u|
- u.model = to_project
- end
+ moved = self.new(to_project)
+ moved.object_store = uploader.object_store
+ moved.filename = uploader.filename
moved.copy_file(uploader.file)
moved