Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2017-12-05 18:12:11 +0300
committerMatija Čupić <matteeyah@gmail.com>2017-12-05 18:15:17 +0300
commit4d75901c027ecd5e7f08b63c1b5d7f96be74981e (patch)
treea5a608876a516f6d3c59fb023a0a3f424dafff83 /app/controllers/projects/clusters_controller.rb
parentf81503a0612b73fdc795b6820f62478eea865e06 (diff)
Use ClustersFinder for setting counts
Diffstat (limited to 'app/controllers/projects/clusters_controller.rb')
-rw-r--r--app/controllers/projects/clusters_controller.rb7
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