gitlab-org--gitlab-foss/app/services/issuable/destroy_service.rb
Sean McGivern ef454f68e8 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.
2017-12-18 12:23:00 +00:00

11 lines
265 B
Ruby

module Issuable
class DestroyService < IssuableBaseService
def execute(issuable)
TodoService.new.destroy_target(issuable) do |issuable|
if issuable.destroy
issuable.update_project_counter_caches
end
end
end
end
end