From a2842241d4f583625053aba4d2c37a2f15b21913 Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Thu, 3 Jan 2019 10:59:14 +0000 Subject: Add committers and authors methods on MergeRequest These are used by the EE-only approvers feature --- app/models/commit_collection.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/commit_collection.rb') 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 -- cgit v1.2.1