summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-07-22 11:44:20 +0000
committerJames Lopez <james@gitlab.com>2019-07-22 11:44:20 +0000
commit972b5f4555f70fdb47c5b3dc78127377b7220cad (patch)
treeae8b41fe06336a8cbf31307d5fdbd3a03fd62c01 /app/finders
parent5ca1899a5f436cd1a8d0f6938fa1c22c1fd3d1a3 (diff)
downloadgitlab-ce-972b5f4555f70fdb47c5b3dc78127377b7220cad.tar.gz
Removed project autocomplete pagination
This pagination is not used anywhere so there is no reason to keep it. It seems the usage of offset_id was probably removed in 90c60138db4e1f86026aac5760febe4ba066ca30
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/autocomplete/move_to_project_finder.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/finders/autocomplete/move_to_project_finder.rb b/app/finders/autocomplete/move_to_project_finder.rb
index edaf74c5f92..491cce2232e 100644
--- a/app/finders/autocomplete/move_to_project_finder.rb
+++ b/app/finders/autocomplete/move_to_project_finder.rb
@@ -3,7 +3,9 @@
module Autocomplete
# Finder that retrieves a list of projects that an issue can be moved to.
class MoveToProjectFinder
- attr_reader :current_user, :search, :project_id, :offset_id
+ attr_reader :current_user, :search, :project_id
+
+ LIMIT = 20
# current_user - The User object of the user that wants to view the list of
# projects.
@@ -14,13 +16,10 @@ module Autocomplete
#
# * search: An optional search query to apply to the list of projects.
# * project_id: The ID of a project to exclude from the returned relation.
- # * offset_id: The ID of a project to use for pagination. When given, only
- # projects with a lower ID are included in the list.
def initialize(current_user, params = {})
@current_user = current_user
@search = params[:search]
@project_id = params[:project_id]
- @offset_id = params[:offset_id]
end
def execute
@@ -28,8 +27,8 @@ module Autocomplete
.projects_where_can_admin_issues
.optionally_search(search)
.excluding_project(project_id)
- .paginate_in_descending_order_using_id(before: offset_id)
.eager_load_namespace_and_owner
+ .sorted_by_name_asc_limited(LIMIT)
end
end
end