diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-29 12:06:40 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-29 12:06:40 +0000 |
commit | d64e3a8b281d355c7d51d04df52fab407b8cc76d (patch) | |
tree | 282d6cc62eacd3fb4a0f6841ae52ae4a709e303f /app/models/merge_request.rb | |
parent | 833eadad8cac85b99871842854c9a676a607e2da (diff) | |
download | gitlab-ce-d64e3a8b281d355c7d51d04df52fab407b8cc76d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index cd8ede3905a..250bac95b82 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -209,14 +209,20 @@ class MergeRequest < ApplicationRecord scope :by_target_branch, ->(branch_name) { where(target_branch: branch_name) } scope :preload_source_project, -> { preload(:source_project) } - scope :with_open_merge_when_pipeline_succeeds, -> do - with_state(:opened).where(merge_when_pipeline_succeeds: true) + scope :with_auto_merge_enabled, -> do + with_state(:opened).where(auto_merge_enabled: true) end after_save :keep_around_commit alias_attribute :project, :target_project alias_attribute :project_id, :target_project_id + + # Currently, `merge_when_pipeline_succeeds` column is used as a flag + # to check if _any_ auto merge strategy is activated on the merge request. + # Today, we have multiple strategies and MWPS is one of them. + # we'd eventually rename the column for avoiding confusions, but in the mean time + # please use `auto_merge_enabled` alias instead of `merge_when_pipeline_succeeds`. alias_attribute :auto_merge_enabled, :merge_when_pipeline_succeeds alias_method :issuing_parent, :target_project |