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:
parent
9aabd8fd5e
commit
83c3e82d6d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue