Commit 85771063 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Split complex method Issues::UpdateService#execute

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 7f0b4ce1
...@@ -22,24 +22,27 @@ module Issues ...@@ -22,24 +22,27 @@ module Issues
issue, issue.labels - old_labels, old_labels - issue.labels) issue, issue.labels - old_labels, old_labels - issue.labels)
end end
if issue.previous_changes.include?('milestone_id') handle_changes(issue)
create_milestone_note(issue)
end
if issue.previous_changes.include?('assignee_id')
create_assignee_note(issue)
notification_service.reassigned_issue(issue, current_user)
end
if issue.previous_changes.include?('title')
create_title_change_note(issue, issue.previous_changes['title'].first)
end
issue.create_new_cross_references!(current_user) issue.create_new_cross_references!(current_user)
execute_hooks(issue, 'update') execute_hooks(issue, 'update')
end end
issue issue
end end
def handle_changes(issue)
if issue.previous_changes.include?('milestone_id')
create_milestone_note(issue)
end
if issue.previous_changes.include?('assignee_id')
create_assignee_note(issue)
notification_service.reassigned_issue(issue, current_user)
end
if issue.previous_changes.include?('title')
create_title_change_note(issue, issue.previous_changes['title'].first)
end
end
end end
end end
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