diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-03-07 00:07:16 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-03-07 16:59:17 +0100 |
commit | 83c3e82d6d74cee47373b8586cfcfee8f6835c7d (patch) | |
tree | 9169bcb4a09f392f0c947607867d539173abe30f /app/services | |
parent | 9aabd8fd5ecb4090515db48692f3d064624aec0a (diff) | |
download | gitlab-ce-83c3e82d6d74cee47373b8586cfcfee8f6835c7d.tar.gz |
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
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index c8b112132b3..3b3d9239086 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -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 |