Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb13
1 files changed, 3 insertions, 10 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index e444111119b..8e1f4979602 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -60,7 +60,7 @@ class Note < ApplicationRecord
# Attribute used to determine whether keep_around_commits will be skipped for diff notes.
attr_accessor :skip_keep_around_commits
- default_value_for :system, false
+ attribute :system, default: false
attr_mentionable :note, pipeline: :note
participant :author
@@ -361,14 +361,6 @@ class Note < ApplicationRecord
super(noteable_type.to_s.classify.constantize.base_class.to_s)
end
- def noteable_assignee_or_author?(user)
- return false unless user
- return false unless noteable.respond_to?(:author_id)
- return noteable.assignee_or_author?(user) if [MergeRequest, Issue].include?(noteable.class)
-
- noteable.author_id == user.id
- end
-
def contributor?
project&.team&.contributor?(self.author_id)
end
@@ -756,7 +748,8 @@ class Note < ApplicationRecord
if user_visible_reference_count.present? && total_reference_count.present?
# if they are not equal, then there are private/confidential references as well
- user_visible_reference_count > 0 && user_visible_reference_count == total_reference_count
+ total_reference_count == 0 ||
+ user_visible_reference_count > 0 && user_visible_reference_count == total_reference_count
else
refs = all_references(user)
refs.all.any? && refs.all_visible?