Rename MergeRequest#async_merge to merge_async

This commit is contained in:
Oswaldo Ferreira 2017-08-28 15:55:25 -03:00
parent 9068083f86
commit ffc576d7df
5 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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