gitlab-org--gitlab-foss/app/workers/auto_merge_worker.rb

14 lines
450 B
Ruby
Raw Normal View History

2015-01-09 22:10:01 -05:00
class AutoMergeWorker
include Sidekiq::Worker
sidekiq_options queue: :default
def perform(merge_request_id, current_user_id, params)
params = params.with_indifferent_access
current_user = User.find(current_user_id)
merge_request = MergeRequest.find(merge_request_id)
merge_request.should_remove_source_branch = params[:should_remove_source_branch]
merge_request.automerge!(current_user, params[:commit_message])
end
end