From 2fa7d2ddf6a7004f89616e43b8279229af831e25 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 14 Nov 2019 09:06:15 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/models/issue.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/issue.rb b/app/models/issue.rb index 5966db21813..948cadc34e5 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -66,6 +66,8 @@ class Issue < ApplicationRecord scope :public_only, -> { where(confidential: false) } scope :confidential_only, -> { where(confidential: true) } + scope :counts_by_state, -> { reorder(nil).group(:state).count } + after_commit :expire_etag_cache after_save :ensure_metrics, unless: :imported? -- cgit v1.2.1