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
iv
gitlab-ce
Commits
8c89beb6
Commit
8c89beb6
authored
Oct 26, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change argument order for satellite actions to always start with the user
parent
35b7a539
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/models/merge_request.rb
app/models/merge_request.rb
+2
-2
lib/gitlab/satellite/action.rb
lib/gitlab/satellite/action.rb
+2
-2
lib/gitlab/satellite/merge_action.rb
lib/gitlab/satellite/merge_action.rb
+2
-2
No files found.
app/models/merge_request.rb
View file @
8c89beb6
...
@@ -60,7 +60,7 @@ class MergeRequest < ActiveRecord::Base
...
@@ -60,7 +60,7 @@ class MergeRequest < ActiveRecord::Base
end
end
def
check_if_can_be_merged
def
check_if_can_be_merged
self
.
state
=
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
self
,
self
.
author
).
can_be_merged?
self
.
state
=
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
self
.
author
,
self
).
can_be_merged?
CAN_BE_MERGED
CAN_BE_MERGED
else
else
CANNOT_BE_MERGED
CANNOT_BE_MERGED
...
@@ -167,7 +167,7 @@ class MergeRequest < ActiveRecord::Base
...
@@ -167,7 +167,7 @@ class MergeRequest < ActiveRecord::Base
end
end
def
automerge!
(
current_user
)
def
automerge!
(
current_user
)
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
self
,
current_user
).
merge!
&&
self
.
unmerged_commits
.
empty?
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
current_user
,
self
).
merge!
&&
self
.
unmerged_commits
.
empty?
self
.
merge!
(
current_user
.
id
)
self
.
merge!
(
current_user
.
id
)
true
true
end
end
...
...
lib/gitlab/satellite/action.rb
View file @
8c89beb6
...
@@ -5,10 +5,10 @@ module Gitlab
...
@@ -5,10 +5,10 @@ module Gitlab
attr_accessor
:options
,
:project
,
:user
attr_accessor
:options
,
:project
,
:user
def
initialize
(
project
,
user
,
options
=
{})
def
initialize
(
user
,
project
,
options
=
{})
@options
=
DEFAULT_OPTIONS
.
merge
(
options
)
@project
=
project
@project
=
project
@user
=
user
@user
=
user
@options
=
DEFAULT_OPTIONS
.
merge
(
options
)
end
end
protected
protected
...
...
lib/gitlab/satellite/merge_action.rb
View file @
8c89beb6
...
@@ -3,8 +3,8 @@ module Gitlab
...
@@ -3,8 +3,8 @@ module Gitlab
class
MergeAction
<
Action
class
MergeAction
<
Action
attr_accessor
:merge_request
attr_accessor
:merge_request
def
initialize
(
merge_request
,
user
)
def
initialize
(
user
,
merge_request
)
super
merge_request
.
project
,
user
super
user
,
merge_request
.
project
@merge_request
=
merge_request
@merge_request
=
merge_request
end
end
...
...
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