Class: MergeRequests::ReopenService

Inherits:
BaseService show all
Defined in:
app/services/merge_requests/reopen_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#create_note, #create_title_change_note, #execute_hooks, #hook_data

Methods inherited from BaseService

#abilities, #can?, #deny_visibility_level, #event_service, #initialize, #log_info, #notification_service, #repository, #system_hook_service, #todo_service

Methods included from Gitlab::CurrentSettings

#current_application_settings, #fake_application_settings

Constructor Details

This class inherits a constructor from BaseService

Instance Method Details

#execute(merge_request) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/services/merge_requests/reopen_service.rb', line 3

def execute(merge_request)
  if merge_request.reopen
    event_service.reopen_mr(merge_request, current_user)
    create_note(merge_request)
    notification_service.reopen_mr(merge_request, current_user)
    execute_hooks(merge_request, 'reopen')
    merge_request.reload_code
    merge_request.mark_as_unchecked
  end

  merge_request
end