debian-mirror-gitlab/app/finders/achievements/achievements_finder.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
503 B
Ruby
Raw Normal View History

2023-06-20 00:43:36 +05:30
# frozen_string_literal: true
module Achievements
class AchievementsFinder
attr_reader :namespace, :params
def initialize(namespace, params = {})
@namespace = namespace
@params = params
end
def execute
achievements = namespace.achievements
by_ids(achievements)
end
private
def by_ids(achievements)
return achievements unless ids?
achievements.id_in(params[:ids])
end
def ids?
params[:ids].present?
end
end
end