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
38ef3955
Commit
38ef3955
authored
Jan 24, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove callback as we already update accordingly on services
parent
c5893d5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
24 deletions
+0
-24
app/models/merge_request.rb
app/models/merge_request.rb
+0
-7
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+0
-17
No files found.
app/models/merge_request.rb
View file @
38ef3955
...
...
@@ -56,7 +56,6 @@ class MergeRequest < ActiveRecord::Base
after_create
:ensure_merge_request_diff
,
unless: :importing?
after_update
:clear_memoized_shas
after_update
:reload_diff_if_branch_changed
after_update
:mark_as_unchecked_if_target_branch_changed
# When this attribute is true some MR validation is ignored
# It allows us to close or modify broken merge requests
...
...
@@ -562,12 +561,6 @@ class MergeRequest < ActiveRecord::Base
end
end
def
mark_as_unchecked_if_target_branch_changed
return
unless
target_branch_changed?
mark_as_unchecked
end
def
reload_diff
(
current_user
=
nil
)
return
unless
open
?
...
...
spec/models/merge_request_spec.rb
View file @
38ef3955
...
...
@@ -77,23 +77,6 @@ describe MergeRequest do
expect
(
MergeRequest
::
Metrics
.
count
).
to
eq
(
1
)
end
end
describe
'#mark_as_unchecked_if_target_branch_changed'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
merge_status: :can_be_merged
)
}
it
'marks MR as unchecked if target_branch changes'
do
expect
{
merge_request
.
update!
(
target_branch:
'bar'
)
}
.
to
change
(
merge_request
,
:merge_status
)
.
from
(
'can_be_merged'
)
.
to
(
'unchecked'
)
end
it
'does not marks MR as unchecked when target_branch does not changes'
do
expect
{
merge_request
.
update!
(
title:
'foo'
)
}
.
not_to
change
(
merge_request
,
:merge_status
)
.
from
(
'can_be_merged'
)
end
end
end
describe
'respond to'
do
...
...
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