summaryrefslogtreecommitdiff
path: root/app/helpers/issuables_helper.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-08-24 18:17:04 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2017-09-05 11:53:45 +0200
commit42062a454a650d81d9fe6dddde7b39b056ec0a88 (patch)
tree2c4be27afab763e04404ddd32b021a098a5cfc15 /app/helpers/issuables_helper.rb
parent3d61421fb2ed22d64a6b20701d600a38db1458f5 (diff)
downloadgitlab-ce-42062a454a650d81d9fe6dddde7b39b056ec0a88.tar.gz
Re-use issue/MR counts for the pagination systemmr-index-page-performance
This changes the issue and MR index pages so the pagination system re-uses the output of the COUNT(*) query used to calculate the number of rows per state (opened, closed, etc). This removes the need for an additional COUNT(*) on both pages.
Diffstat (limited to 'app/helpers/issuables_helper.rb')
-rw-r--r--app/helpers/issuables_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index 681615dbf3e..717abf2082d 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -240,7 +240,8 @@ module IssuablesHelper
def issuables_count_for_state(issuable_type, state)
finder = public_send("#{issuable_type}_finder") # rubocop:disable GitlabSecurity/PublicSend
- finder.count_by_state[state]
+
+ Gitlab::IssuablesCountForState.new(finder)[state]
end
def close_issuable_url(issuable)