summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-08-28 08:27:21 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-08-28 08:27:21 +0000
commit4576d55f44cfec6d6cab0df063ae9c26824222dd (patch)
treef66d553cb3f8489d76ba9789b55cb52d9e4fc721 /app/models
parentfe641cbd6a7d2e0598cdc34b50ad683ee078af84 (diff)
parent72544449cfb8e35b8c044f5bfd08a2fae2253408 (diff)
downloadgitlab-ce-4576d55f44cfec6d6cab0df063ae9c26824222dd.tar.gz
Merge branch 'id-change-total-notes-calculation' into 'master'
Change the way totalNotes is calculated See merge request gitlab-org/gitlab-ce!32191
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/noteable.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb
index 4b428b0af83..6a44bc7c401 100644
--- a/app/models/concerns/noteable.rb
+++ b/app/models/concerns/noteable.rb
@@ -73,6 +73,10 @@ module Noteable
.discussions(self)
end
+ def capped_notes_count(max)
+ notes.limit(max).count
+ end
+
def grouped_diff_discussions(*args)
# Doesn't use `discussion_notes`, because this may include commit diff notes
# besides MR diff notes, that we do not want to display on the MR Changes tab.