Commit 83c3e82d authored by Bob Van Landuyt's avatar Bob Van Landuyt

Use Project#source_of_merge_requests-relation

Using the relation `Project#source_of_merge_requests` in
`Ci::CreatePipelineService`

That way we take advantage of all the `ActiveRecord::Relation` magic
parent 9aabd8fd
......@@ -81,7 +81,7 @@ module Ci
end
def related_merge_requests
MergeRequest.opened.where(source_project: pipeline.project, source_branch: pipeline.ref)
pipeline.project.source_of_merge_requests.opened.where(source_branch: pipeline.ref)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment