diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-08-24 19:17:04 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-09-05 12:53:45 +0300 |
commit | 42062a454a650d81d9fe6dddde7b39b056ec0a88 (patch) | |
tree | 2c4be27afab763e04404ddd32b021a098a5cfc15 /app/helpers/issuables_helper.rb | |
parent | 3d61421fb2ed22d64a6b20701d600a38db1458f5 (diff) |
Re-use issue/MR counts for the pagination system
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.rb | 3 |
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) |