diff options
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 1c948c8957e..9dbc018ed3e 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -54,6 +54,7 @@ class Issue < ActiveRecord::Base scope :preload_associations, -> { preload(:labels, project: :namespace) } after_save :expire_etag_cache + after_commit :update_project_counter_caches, on: :destroy attr_spammable :title, spam_title: true attr_spammable :description, spam_description: true @@ -269,6 +270,10 @@ class Issue < ActiveRecord::Base end end + def update_project_counter_caches + Projects::OpenIssuesCountService.new(project).refresh_cache + end + private # Returns `true` if the given User can read the current Issue. |