From e7990a16ded06f495e0c4aa40f8519ab76e00c5b Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Thu, 30 Nov 2017 17:39:50 +0100 Subject: Allow disabling of page numbers using Flipper 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. --- app/helpers/pagination_helper.rb | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 app/helpers/pagination_helper.rb (limited to 'app/helpers') 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 -- cgit v1.2.1