gitlab-org--gitlab-foss/app/services/issuable/destroy_service.rb
m b b099c6ff9f Deleting a MR you are assigned to should decrements counter
The merge request counter in the UI was not decreasing when a merge
request was deleting.

This was just due to the cache not being
refreshed on a delete action.

fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/44458
2018-04-05 13:24:45 -05:00

12 lines
326 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
issuable.assignees.each(&:invalidate_cache_counts)
end
end
end
end
end