diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-19 23:18:09 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-19 23:18:09 +0000 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /app/finders/groups/base.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) | |
download | gitlab-ce-6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde.tar.gz |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'app/finders/groups/base.rb')
-rw-r--r-- | app/finders/groups/base.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/finders/groups/base.rb b/app/finders/groups/base.rb new file mode 100644 index 00000000000..d7f56b1a7a6 --- /dev/null +++ b/app/finders/groups/base.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Groups + class Base + private + + def sort(items) + items.order(Group.arel_table[:path].asc, Group.arel_table[:id].asc) # rubocop: disable CodeReuse/ActiveRecord + end + + def by_search(items) + return items if params[:search].blank? + + items.search(params[:search], include_parents: true) + end + end +end |