diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-10-14 19:13:11 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-10-14 19:13:11 +0800 |
commit | b5f9d4c4bc48b252d3175432a3bb6fb1ca394af9 (patch) | |
tree | 45c5305aaf0baf3b36c9692d8e37cba1011935b1 /app/mailers | |
parent | 5b9971fa9b967eb5591242155d6f5fce2c292b7d (diff) | |
download | gitlab-ce-b5f9d4c4bc48b252d3175432a3bb6fb1ca394af9.tar.gz |
Introduce Pipeline#merge_requests_with_active_first,
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6019#note_16956802
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/pipelines.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb index 903d123705a..92f1431ce66 100644 --- a/app/mailers/emails/pipelines.rb +++ b/app/mailers/emails/pipelines.rb @@ -13,10 +13,7 @@ module Emails def pipeline_mail(pipeline, to, status) @project = pipeline.project @pipeline = pipeline - @merge_request = @project.merge_requests.opened. - find_by(source_project: @project, - source_branch: @pipeline.ref, - target_branch: @project.default_branch) + @merge_request = pipeline.merge_requests_with_active_first.first add_headers mail(to: to, subject: pipeline_subject(status), skip_premailer: true) do |format| |