diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 21:10:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 21:10:21 +0300 |
commit | 1572e2a376c0315a0b910bb06e2f2d08cae43adb (patch) | |
tree | 850c1d90c6cdd107e51061719db07257f0331425 /app/finders | |
parent | 05b83be3ee097da8e71c8655d8f9f2c179cc3f7c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/repositories/branch_names_finder.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/finders/repositories/branch_names_finder.rb b/app/finders/repositories/branch_names_finder.rb index 5bb67425aa5..8c8c7405407 100644 --- a/app/finders/repositories/branch_names_finder.rb +++ b/app/finders/repositories/branch_names_finder.rb @@ -10,9 +10,9 @@ module Repositories end def execute - return unless search + return unless search && offset && limit - repository.search_branch_names(search) + repository.search_branch_names(search).lazy.drop(offset).take(limit) # rubocop:disable CodeReuse/ActiveRecord end private @@ -20,5 +20,13 @@ module Repositories def search @params[:search].presence end + + def offset + @params[:offset] + end + + def limit + @params[:limit] + end end end |