summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-14 09:06:15 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-14 09:06:15 +0000
commit2fa7d2ddf6a7004f89616e43b8279229af831e25 (patch)
tree91b35d62663f12d68f36a3a12c9891150a9ff251 /app
parentd9251dac4c8f9e27f1e2db4b537d47d7d5a9e5be (diff)
downloadgitlab-ce-2fa7d2ddf6a7004f89616e43b8279229af831e25.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/models/issue.rb2
1 files changed, 2 insertions, 0 deletions
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?