[25739] Use remote_file_url for copying attachment (#5892)

Also sets the author to the current user that performed the copy

[ci skip]
pull/5895/head
Oliver Günther 7 years ago committed by GitHub
parent 6ad545124d
commit a6fac9a17a
  1. 2
      app/models/project/copy.rb
  2. 2
      app/uploaders/fog_file_uploader.rb

@ -148,6 +148,8 @@ module Project::Copy
new_issue = WorkPackage.new
new_issue.copy_from(issue)
new_issue.project = self
# Reassign author to the current user
new_issue.author = User.current
# Reassign fixed_versions by name, since names are unique per
# project and the versions for self are not yet saved
if issue.fixed_version

@ -34,7 +34,7 @@ class FogFileUploader < CarrierWave::Uploader::Base
storage :fog
def copy_to(attachment)
attachment.file = remote_file.url
attachment.remote_file_url = remote_file.url
end
def store_dir

Loading…
Cancel
Save