Commit ffc576d7 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Rename MergeRequest#async_merge to merge_async

parent 9068083f
...@@ -318,14 +318,14 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -318,14 +318,14 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
elsif @merge_request.head_pipeline.success? elsif @merge_request.head_pipeline.success?
# This can be triggered when a user clicks the auto merge button while # This can be triggered when a user clicks the auto merge button while
# the tests finish at about the same time # the tests finish at about the same time
@merge_request.async_merge(current_user.id, params) @merge_request.merge_async(current_user.id, params)
:success :success
else else
:failed :failed
end end
else else
@merge_request.async_merge(current_user.id, params) @merge_request.merge_async(current_user.id, params)
:success :success
end end
......
...@@ -244,7 +244,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -244,7 +244,7 @@ class MergeRequest < ActiveRecord::Base
# Calls `MergeWorker` to proceed with the merge process and # Calls `MergeWorker` to proceed with the merge process and
# updates `merge_jid` with the MergeWorker#jid. # updates `merge_jid` with the MergeWorker#jid.
# This helps tracking enqueued and ongoing merge jobs. # This helps tracking enqueued and ongoing merge jobs.
def async_merge(user_id, params) def merge_async(user_id, params)
jid = MergeWorker.perform_async(id, user_id, params) jid = MergeWorker.perform_async(id, user_id, params)
update_column(:merge_jid, jid) update_column(:merge_jid, jid)
end end
......
...@@ -30,7 +30,7 @@ module MergeRequests ...@@ -30,7 +30,7 @@ module MergeRequests
next next
end end
merge_request.async_merge(merge_request.merge_user_id, merge_request.merge_params) merge_request.merge_async(merge_request.merge_user_id, merge_request.merge_params)
end end
end end
......
...@@ -83,7 +83,7 @@ module MergeRequests ...@@ -83,7 +83,7 @@ module MergeRequests
if merge_request.head_pipeline && merge_request.head_pipeline.active? if merge_request.head_pipeline && merge_request.head_pipeline.active?
MergeRequests::MergeWhenPipelineSucceedsService.new(project, current_user).execute(merge_request) MergeRequests::MergeWhenPipelineSucceedsService.new(project, current_user).execute(merge_request)
else else
merge_request.async_merge(current_user.id, {}) merge_request.merge_async(current_user.id, {})
end end
end end
......
...@@ -931,7 +931,7 @@ describe MergeRequest do ...@@ -931,7 +931,7 @@ describe MergeRequest do
end end
end end
describe '#async_merge' do describe '#merge_async' do
it 'enqueues MergeWorker job and updates merge_jid' do it 'enqueues MergeWorker job and updates merge_jid' do
merge_request = create(:merge_request) merge_request = create(:merge_request)
user_id = double(:user_id) user_id = double(:user_id)
...@@ -942,7 +942,7 @@ describe MergeRequest do ...@@ -942,7 +942,7 @@ describe MergeRequest do
merge_jid merge_jid
end end
merge_request.async_merge(user_id, params) merge_request.merge_async(user_id, params)
expect(merge_request.reload.merge_jid).to eq(merge_jid) expect(merge_request.reload.merge_jid).to eq(merge_jid)
end end
......
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