summaryrefslogtreecommitdiff
path: root/app/models/commit_collection.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2019-01-03 10:59:14 +0000
committerDouwe Maan <douwe@selenight.nl>2019-01-08 00:27:29 +0100
commita2842241d4f583625053aba4d2c37a2f15b21913 (patch)
tree088aeb8c89c56e20ea5f003e3556584b5b524232 /app/models/commit_collection.rb
parentcfa7108210490704a8110ee97a26de9ae4d9adaf (diff)
downloadgitlab-ce-a2842241d4f583625053aba4d2c37a2f15b21913.tar.gz
Add committers and authors methods on MergeRequest
These are used by the EE-only approvers feature
Diffstat (limited to 'app/models/commit_collection.rb')
-rw-r--r--app/models/commit_collection.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/commit_collection.rb b/app/models/commit_collection.rb
index e349f0fe971..885f61beb05 100644
--- a/app/models/commit_collection.rb
+++ b/app/models/commit_collection.rb
@@ -19,6 +19,12 @@ class CommitCollection
commits.each(&block)
end
+ def committers
+ emails = commits.reject(&:merge_commit?).map(&:committer_email).uniq
+
+ User.by_any_email(emails)
+ end
+
# Sets the pipeline status for every commit.
#
# Setting this status ahead of time removes the need for running a query for