diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-25 12:08:11 +0300 |
commit | 5064bf8c5647d4c4430cbb4d097cf1592416de29 (patch) | |
tree | d051bf2abe2cc7061b3a7facb6669a56ccb9cf54 /app/models/concerns/noteable.rb | |
parent | 9c83aadd2604e7e6cb1f84683f951e6b12872618 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/noteable.rb')
-rw-r--r-- | app/models/concerns/noteable.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb index 19f2daa1b01..a7f1fb66a88 100644 --- a/app/models/concerns/noteable.rb +++ b/app/models/concerns/noteable.rb @@ -79,6 +79,12 @@ module Noteable .discussions(self) end + def discussion_ids_relation + notes.select(:discussion_id) + .group(:discussion_id) + .order('MIN(created_at), MIN(id)') + end + def capped_notes_count(max) notes.limit(max).count end |