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,6 +22,15 @@ module Issues ...@@ -22,6 +22,15 @@ module Issues
issue, issue.labels - old_labels, old_labels - issue.labels) issue, issue.labels - old_labels, old_labels - issue.labels)
end end
handle_changes(issue)
issue.create_new_cross_references!(current_user)
execute_hooks(issue, 'update')
end
issue
end
def handle_changes(issue)
if issue.previous_changes.include?('milestone_id') if issue.previous_changes.include?('milestone_id')
create_milestone_note(issue) create_milestone_note(issue)
end end
...@@ -34,12 +43,6 @@ module Issues ...@@ -34,12 +43,6 @@ module Issues
if issue.previous_changes.include?('title') if issue.previous_changes.include?('title')
create_title_change_note(issue, issue.previous_changes['title'].first) create_title_change_note(issue, issue.previous_changes['title'].first)
end end
issue.create_new_cross_references!(current_user)
execute_hooks(issue, 'update')
end
issue
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