summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-11-30 17:39:50 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2017-12-01 18:41:07 +0100
commite7990a16ded06f495e0c4aa40f8519ab76e00c5b (patch)
tree717f0472cf95c4ae5e24edc631c3c3d3e6425ea5 /app/helpers
parentc594659fea15c6dd17b9ea4c6b88c5a418f10ab9 (diff)
downloadgitlab-ce-pagination-without-count-flag.tar.gz
Allow disabling of page numbers using Flipperpagination-without-count-flag
This allows page numbers to be disabled globally by enabling the feature "paginate_without_count". This allows us to test the performance impact of not having to run COUNT(*) queries, while still being able to revert easily if necessary. See https://gitlab.com/gitlab-org/gitlab-ce/issues/36077 for more information.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/pagination_helper.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/app/helpers/pagination_helper.rb b/app/helpers/pagination_helper.rb
deleted file mode 100644
index 83dd76a01dd..00000000000
--- a/app/helpers/pagination_helper.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-module PaginationHelper
- def paginate_collection(collection, remote: nil)
- if collection.is_a?(Kaminari::PaginatableWithoutCount)
- paginate_without_count(collection)
- elsif collection.respond_to?(:total_pages)
- paginate_with_count(collection, remote: remote)
- end
- end
-
- def paginate_without_count(collection)
- render(
- 'kaminari/gitlab/without_count',
- previous_path: path_to_prev_page(collection),
- next_path: path_to_next_page(collection)
- )
- end
-
- def paginate_with_count(collection, remote: nil)
- paginate(collection, remote: remote, theme: 'gitlab')
- end
-end