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
This commit is contained in:
Bob Van Landuyt 2018-03-07 00:07:16 +01:00
parent 9aabd8fd5e
commit 83c3e82d6d
1 changed files with 1 additions and 1 deletions

View File

@ -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