gitlab-org--gitlab-foss/app/finders/group_labels_finder.rb
Dmitriy Zaporozhets 9176ea999a
Move group labels AR code into finder
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2018-09-21 16:34:18 +03:00

17 lines
311 B
Ruby

# frozen_string_literal: true
class GroupLabelsFinder
attr_reader :group, :params
def initialize(group, params = {})
@group = group
@params = params
end
def execute
group.labels
.optionally_search(params[:search])
.order_by(params[:sort])
.page(params[:page])
end
end