Commit ed67ba96 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add support for close/reopen actions in update service

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent cc773654
......@@ -3,7 +3,7 @@ module Issues
def execute(issue)
if issue.reopen
event_service.reopen_issue(issue, current_user)
create_note(issue, commit)
create_note(issue)
execute_hooks(issue)
end
......
module Issues
class UpdateService < BaseService
def execute(issue)
if issue.update_attributes(params)
state = params.delete('state_event')
case state
when 'reopen'
Issues::ReopenService.new(project, current_user, {}).execute(issue)
when 'close'
Issues::CloseService.new(project, current_user, {}).execute(issue)
end
if params.present? && issue.update_attributes(params)
issue.reset_events_cache
if issue.is_being_reassigned?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment