diff options
author | Matija Čupić <matteeyah@gmail.com> | 2017-12-05 16:12:11 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2017-12-05 16:15:17 +0100 |
commit | 4d75901c027ecd5e7f08b63c1b5d7f96be74981e (patch) | |
tree | a5a608876a516f6d3c59fb023a0a3f424dafff83 /app/controllers | |
parent | f81503a0612b73fdc795b6820f62478eea865e06 (diff) | |
download | gitlab-ce-4d75901c027ecd5e7f08b63c1b5d7f96be74981e.tar.gz |
Use ClustersFinder for setting counts
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/clusters_controller.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index f3939c74591..0907daacbc3 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -9,10 +9,9 @@ class Projects::ClustersController < Projects::ApplicationController def index @scope = params[:scope] || 'all' - clusters = ClustersFinder.new(project, current_user, @scope).execute - @clusters = clusters.page(params[:page]) - @active_count = project.clusters.enabled.count - @inactive_count = project.clusters.disabled.count + @clusters = ClustersFinder.new(project, current_user, @scope).execute.page(params[:page]) + @active_count = ClustersFinder.new(project, current_user, :active).execute.count + @inactive_count = ClustersFinder.new(project, current_user, :inactive).execute.count @all_count = @active_count + @inactive_count end |