diff options
author | Valery Sizov <valery@gitlab.com> | 2015-10-14 21:02:23 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-10-14 21:02:23 +0300 |
commit | 0b9273a283dc5a30a175a0accb3a5d49dce01be8 (patch) | |
tree | 77a0b55d3ef868b453808e00bcb4d624846af139 /app/services | |
parent | ffb99edc26311fb0e0eb70f33119fac1325b3ed4 (diff) | |
parent | 8f584d5f2c8dc036214a7fc71ce864fe23b4cb9e (diff) |
Merge branch 'uploads_path_fix' into 'master'
Fix: Images cannot show when projects' path was changed
Fixes #1443
See merge request !1521
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/projects/transfer_service.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb index c327c244f0d..64ea6dd42eb 100644 --- a/app/services/projects/transfer_service.rb +++ b/app/services/projects/transfer_service.rb @@ -27,6 +27,7 @@ module Projects def transfer(project, new_namespace) Project.transaction do old_path = project.path_with_namespace + old_namespace = project.namespace new_path = File.join(new_namespace.try(:path) || '', project.path) if Project.where(path: project.path, namespace_id: new_namespace.try(:id)).present? @@ -51,6 +52,9 @@ module Projects # clear project cached events project.reset_events_cache + # Move uploads + Gitlab::UploadsTransfer.new.move_project(project.path, old_namespace.path, new_namespace.path) + true end end |