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

23 lines
538 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
module Issues
class ReopenService < Issues::BaseService
def execute(issue)
2016-09-13 17:45:13 +05:30
return issue unless can?(current_user, :update_issue, issue)
2014-09-02 18:07:02 +05:30
if issue.reopen
event_service.reopen_issue(issue, current_user)
create_note(issue)
notification_service.reopen_issue(issue, current_user)
execute_hooks(issue, 'reopen')
end
issue
end
private
def create_note(issue)
2015-09-11 14:41:01 +05:30
SystemNoteService.change_status(issue, issue.project, current_user, issue.state, nil)
2014-09-02 18:07:02 +05:30
end
end
end