gitlab-org--gitlab-foss/app/finders/admin/plans_finder.rb

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

25 lines
400 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Admin
class PlansFinder
attr_reader :params
def initialize(params = {})
@params = params
end
def execute
plans = Plan.all
by_name(plans)
end
private
def by_name(plans)
return plans unless params[:name]
Plan.find_by(name: params[:name]) # rubocop: disable CodeReuse/ActiveRecord
end
end
end