Commit 38ef3955 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Remove callback as we already update accordingly on services

parent c5893d5c
...@@ -56,7 +56,6 @@ class MergeRequest < ActiveRecord::Base ...@@ -56,7 +56,6 @@ class MergeRequest < ActiveRecord::Base
after_create :ensure_merge_request_diff, unless: :importing? after_create :ensure_merge_request_diff, unless: :importing?
after_update :clear_memoized_shas after_update :clear_memoized_shas
after_update :reload_diff_if_branch_changed 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 # When this attribute is true some MR validation is ignored
# It allows us to close or modify broken merge requests # It allows us to close or modify broken merge requests
...@@ -562,12 +561,6 @@ class MergeRequest < ActiveRecord::Base ...@@ -562,12 +561,6 @@ class MergeRequest < ActiveRecord::Base
end end
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) def reload_diff(current_user = nil)
return unless open? return unless open?
......
...@@ -77,23 +77,6 @@ describe MergeRequest do ...@@ -77,23 +77,6 @@ describe MergeRequest do
expect(MergeRequest::Metrics.count).to eq(1) expect(MergeRequest::Metrics.count).to eq(1)
end end
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 end
describe 'respond to' do describe 'respond to' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment