summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2017-09-29 19:07:27 +0300
committerValery Sizov <valery@gitlab.com>2017-09-29 19:07:27 +0300
commitbd68e9add190c5472e309f5d046194d544aa64ce (patch)
treee7fa9637c2d5232544f0c5b91f293a59cccaee7b /app/models/project.rb
parent3468ca835d6b5f410ffeba3bbe3964371ef8349f (diff)
downloadgitlab-ce-bd68e9add190c5472e309f5d046194d544aa64ce.tar.gz
[Port semi-linear history from EE] Move migration to CE and `merge_method` method
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 1c3a78ff05a..fe442755619 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1567,13 +1567,25 @@ class Project < ActiveRecord::Base
def merge_method
if self.merge_requests_ff_only_enabled
:ff
+ elsif self.merge_requests_rebase_enabled
+ :rebase_merge
else
:merge
end
end
def merge_method=(method)
- self.merge_requests_ff_only_enabled = method.to_s == "ff"
+ case method.to_s
+ when "ff"
+ self.merge_requests_ff_only_enabled = true
+ self.merge_requests_rebase_enabled = true
+ when "rebase_merge"
+ self.merge_requests_ff_only_enabled = false
+ self.merge_requests_rebase_enabled = true
+ when "merge"
+ self.merge_requests_ff_only_enabled = false
+ self.merge_requests_rebase_enabled = false
+ end
end
def ff_merge_must_be_possible?