Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
bd68e9ad
Commit
bd68e9ad
authored
Sep 29, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Port semi-linear history from EE] Move migration to CE and `merge_method` method
parent
3468ca83
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
app/models/project.rb
app/models/project.rb
+13
-1
db/migrate/20141126120926_add_merge_request_rebase_enabled_to_projects.rb
...126120926_add_merge_request_rebase_enabled_to_projects.rb
+17
-0
db/schema.rb
db/schema.rb
+1
-0
No files found.
app/models/project.rb
View file @
bd68e9ad
...
...
@@ -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?
...
...
db/migrate/20141126120926_add_merge_request_rebase_enabled_to_projects.rb
0 → 100644
View file @
bd68e9ad
# rubocop:disable all
class
AddMergeRequestRebaseEnabledToProjects
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column_with_default
(
:projects
,
:merge_requests_rebase_enabled
,
:boolean
,
default:
false
)
end
def
down
remove_column
(
:projects
,
:merge_requests_rebase_enabled
)
end
end
db/schema.rb
View file @
bd68e9ad
...
...
@@ -1217,6 +1217,7 @@ ActiveRecord::Schema.define(version: 20170921115009) do
t
.
boolean
"resolve_outdated_diff_discussions"
t
.
boolean
"repository_read_only"
t
.
boolean
"merge_requests_ff_only_enabled"
,
default:
false
t
.
boolean
"merge_requests_rebase_enabled"
,
default:
false
,
null:
false
end
add_index
"projects"
,
[
"ci_id"
],
name:
"index_projects_on_ci_id"
,
using: :btree
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment