2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-01 08:38:45 -04:00
|
|
|
class NewMergeRequestWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2017-08-01 08:38:45 -04:00
|
|
|
include NewIssuable
|
|
|
|
|
|
|
|
def perform(merge_request_id, user_id)
|
2017-08-08 03:41:27 -04:00
|
|
|
return unless objects_found?(merge_request_id, user_id)
|
2017-08-01 08:38:45 -04:00
|
|
|
|
|
|
|
EventCreateService.new.open_mr(issuable, user)
|
|
|
|
NotificationService.new.new_merge_request(issuable, user)
|
2018-09-04 16:06:34 -04:00
|
|
|
|
|
|
|
issuable.diffs.write_cache
|
2017-08-01 08:38:45 -04:00
|
|
|
issuable.create_cross_references!(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
def issuable_class
|
|
|
|
MergeRequest
|
|
|
|
end
|
|
|
|
end
|