debian-mirror-gitlab/app/finders/groups/base.rb
2022-10-11 01:57:18 +05:30

17 lines
364 B
Ruby

# 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