Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-12-08 15:17:22 +0300
committerSean McGivern <sean@gitlab.com>2017-12-18 15:23:00 +0300
commitef454f68e837e4e7360fe1518686dd56adbbb0a9 (patch)
tree72e67bbf1a2222d8a1007298478350b5cc9c02bd /app/services/notes
parent9429e8ac60a10436a0469d7d206d3f74a2c966c7 (diff)
Reset todo counters when the target is deleted
When the target is deleted, todos are destroyed, but we did not reset the todo cache for users with todos on the deleted target. This would only update after the next time the todo cache was updated for that user.
Diffstat (limited to 'app/services/notes')
-rw-r--r--app/services/notes/destroy_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/notes/destroy_service.rb b/app/services/notes/destroy_service.rb
index b819bd17039..fb78420d324 100644
--- a/app/services/notes/destroy_service.rb
+++ b/app/services/notes/destroy_service.rb
@@ -1,7 +1,9 @@
module Notes
class DestroyService < BaseService
def execute(note)
- note.destroy
+ TodoService.new.destroy_target(note) do |note|
+ note.destroy
+ end
end
end
end