debian-mirror-gitlab/app/services/merge_requests/reopen_service.rb

20 lines
664 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
module MergeRequests
class ReopenService < MergeRequests::BaseService
def execute(merge_request)
2016-09-13 17:45:13 +05:30
return merge_request unless can?(current_user, :update_merge_request, merge_request)
2014-09-02 18:07:02 +05:30
if merge_request.reopen
event_service.reopen_mr(merge_request, current_user)
2017-09-10 17:25:29 +05:30
create_note(merge_request, 'reopened')
2015-04-26 12:48:37 +05:30
notification_service.reopen_mr(merge_request, current_user)
execute_hooks(merge_request, 'reopen')
2017-09-10 17:25:29 +05:30
merge_request.reload_diff(current_user)
2014-09-02 18:07:02 +05:30
merge_request.mark_as_unchecked
2017-09-10 17:25:29 +05:30
invalidate_cache_counts(merge_request, users: merge_request.assignees)
2014-09-02 18:07:02 +05:30
end
merge_request
end
end
end