summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-01-13 16:37:17 +0100
committerRémy Coutable <remy@rymai.me>2016-01-13 16:37:17 +0100
commit5efbfa14d4666655edd6d79a3a352a134382b664 (patch)
tree9403dc20882c9285e6dfc09bb9da66e6da30dc15 /app/models/note.rb
parent9d7f88c12258e27a189e8229090920db0627e88b (diff)
downloadgitlab-ce-5efbfa14d4666655edd6d79a3a352a134382b664.tar.gz
Move complex view condition to a model method
This is moved to a model method rather than an helper method because the API will need it too.
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 3d5b663c99f..3e1375e5ad6 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -358,6 +358,10 @@ class Note < ActiveRecord::Base
!system? && !is_award
end
+ def cross_reference_not_visible_for?(user)
+ cross_reference? && referenced_mentionables(user).empty?
+ end
+
# Checks if note is an award added as a comment
#
# If note is an award, this method sets is_award to true