49f977d675
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
20 lines
504 B
Ruby
20 lines
504 B
Ruby
module Issues
|
|
class CloseService < Issues::BaseService
|
|
def execute(issue, commit = nil)
|
|
if issue.close
|
|
notification_service.close_issue(issue, current_user)
|
|
event_service.close_issue(issue, current_user)
|
|
create_note(issue, commit)
|
|
execute_hooks(issue)
|
|
end
|
|
|
|
issue
|
|
end
|
|
|
|
private
|
|
|
|
def create_note(issue, current_commit)
|
|
Note.create_status_change_note(issue, issue.project, current_user, issue.state, current_commit)
|
|
end
|
|
end
|
|
end
|