debian-mirror-gitlab/app/finders/groups/base.rb
2023-04-23 21:23:45 +05:30

17 lines
366 B
Ruby

# 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