summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:25:58 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 18:25:58 +0000
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /app/models/note.rb
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
downloadgitlab-ce-14.0.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index ae4a8859d4d..d1a59394ba1 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -96,7 +96,9 @@ class Note < ApplicationRecord
validate :does_not_exceed_notes_limit?, on: :create, unless: [:system?, :importing?]
- # @deprecated attachments are handler by the MarkdownUploader
+ # @deprecated attachments are handled by the Upload model.
+ #
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/20830
mount_uploader :attachment, AttachmentUploader
# Scopes
@@ -274,6 +276,10 @@ class Note < ApplicationRecord
noteable_type == 'AlertManagement::Alert'
end
+ def for_vulnerability?
+ noteable_type == "Vulnerability"
+ end
+
def for_project_snippet?
noteable.is_a?(ProjectSnippet)
end
@@ -409,6 +415,8 @@ class Note < ApplicationRecord
'snippet'
elsif for_alert_mangement_alert?
'alert_management_alert'
+ elsif for_vulnerability?
+ 'security_resource'
else
noteable_type.demodulize.underscore
end