BigW Consortium Gitlab

Create ClustersFinder

parent 52bc8261
No related merge requests found
class ClustersFinder
def initialize(project, user, scope)
@project = project
@user = user
@scope = scope
end
def execute
clusters = case @scope
when :all
project.clusters
when :disabled
project.clusters.enabled
when :enabled
project.clusters.disabled
end
clusters.map { |cluster| cluster.present(current_user: @user) }
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment