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
elsif @merge_request.head_pipeline.success?
# This can be triggered when a user clicks the auto merge button while
# 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
else
:failed
end
else
@merge_request.async_merge(current_user.id, params)
@merge_request.merge_async(current_user.id, params)
:success
end
......
......@@ -244,7 +244,7 @@ class MergeRequest < ActiveRecord::Base
# Calls `MergeWorker` to proceed with the merge process and
# updates `merge_jid` with the MergeWorker#jid.
# 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)
update_column(:merge_jid, jid)
end
......
......@@ -30,7 +30,7 @@ module MergeRequests
next
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
......
......@@ -83,7 +83,7 @@ module MergeRequests
if merge_request.head_pipeline && merge_request.head_pipeline.active?
MergeRequests::MergeWhenPipelineSucceedsService.new(project, current_user).execute(merge_request)
else
merge_request.async_merge(current_user.id, {})
merge_request.merge_async(current_user.id, {})
end
end
......
......@@ -931,7 +931,7 @@ describe MergeRequest do
end
end
describe '#async_merge' do
describe '#merge_async' do
it 'enqueues MergeWorker job and updates merge_jid' do
merge_request = create(:merge_request)
user_id = double(:user_id)
......@@ -942,7 +942,7 @@ describe MergeRequest do
merge_jid
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)
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