Commit 20896b28 authored by Kerri Miller's avatar Kerri Miller

Move #mark_as_checked last and add comment

parent d8acf44c
......@@ -60,13 +60,6 @@ module MergeRequests
track_title_and_desc_edits(merge_request, changed_fields)
if merge_request.previous_changes.include?('target_branch') ||
merge_request.previous_changes.include?('source_branch')
merge_request.mark_as_unchecked
end
handle_milestone_change(merge_request)
added_labels = merge_request.labels - old_labels
if added_labels.present?
notification_service.async.relabeled_merge_request(
......@@ -85,6 +78,15 @@ module MergeRequests
current_user
)
end
# Since #mark_as_unchecked triggers an update action through the MR's
# state machine, we want to push this as far down in the process so we
# avoid resetting #ActiveModel::Dirty
#
if merge_request.previous_changes.include?('target_branch') ||
merge_request.previous_changes.include?('source_branch')
merge_request.mark_as_unchecked
end
end
# rubocop:enable Metrics/AbcSize
......
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