summaryrefslogtreecommitdiff
path: root/app/uploaders/attachment_uploader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/uploaders/attachment_uploader.rb')
-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