Welcome to mirror list, hosted at ThFree Co, Russian Federation.

base.rb « groups « finders « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9d2f9f60a630ad8ad94fdbcf0c23bf3fd84250e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Groups
  class Base
    private

    def sort(items)
      items.reorder(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