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: d7f56b1a7a66ee18bf8cdd352b0ce841778afb0d (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.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