summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 00:09:34 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 00:09:34 +0000
commit3cd08f4bf96cda3e9d3abf233095107832b17c20 (patch)
treedc09a618783a79d70f2a404374d4b850ccf9cc84 /app/uploaders
parentdd4bee69b7d55620f7dc9db8c36b478bd4959755 (diff)
downloadgitlab-ce-3cd08f4bf96cda3e9d3abf233095107832b17c20.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/attachment_uploader.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb
index b488bba00e9..47de6fe0fbd 100644
--- a/app/uploaders/attachment_uploader.rb
+++ b/app/uploaders/attachment_uploader.rb
@@ -11,4 +11,15 @@ class AttachmentUploader < GitlabUploader
def dynamic_segment
File.join(model.class.underscore, mounted_as.to_s, model.id.to_s)
end
+
+ def mounted_as
+ # Geo fails to sync attachments on Note, and LegacyDiffNotes with missing mount_point.
+ #
+ # See https://gitlab.com/gitlab-org/gitlab/-/issues/209752 for more details.
+ if model.class.underscore.include?('note')
+ super || 'attachment'
+ else
+ super
+ end
+ end
end