From db6b2b18990297d98bd74af1d2f475d0d42ec443 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 26 Sep 2016 17:18:30 +0800 Subject: Show open merge request against default branch if exists --- app/mailers/emails/pipelines.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/mailers/emails') diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb index e132105807a..2b2b7a4f08c 100644 --- a/app/mailers/emails/pipelines.rb +++ b/app/mailers/emails/pipelines.rb @@ -13,6 +13,10 @@ 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) add_headers mail(to: to, subject: pipeline_subject(status)) -- cgit v1.2.3