summaryrefslogtreecommitdiff
path: root/app/controllers/projects/pipelines_controller.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-08-29 18:02:08 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-09-07 15:38:03 +0200
commit3152477114ed95d2ca5b5a27487c4f392f7486fa (patch)
tree76f12a95dbb8b25a4a8e37d1e3ee17880329b3fc /app/controllers/projects/pipelines_controller.rb
parenta83c5ff48f74c718bd4d0f9b5746502e2ebaff27 (diff)
downloadgitlab-ce-3152477114ed95d2ca5b5a27487c4f392f7486fa.tar.gz
Use PipelinesFinder in Pipelines API
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r--app/controllers/projects/pipelines_controller.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index b0c72cfe4b4..371cc3787fb 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -7,11 +7,10 @@ class Projects::PipelinesController < Projects::ApplicationController
def index
@scope = params[:scope]
- all_pipelines = project.pipelines
- @pipelines_count = all_pipelines.count
- @running_or_pending_count = all_pipelines.running_or_pending.count
- @pipelines = PipelinesFinder.new(project).execute(all_pipelines, @scope)
- @pipelines = @pipelines.order(id: :desc).page(params[:page]).per(30)
+ @pipelines = PipelinesFinder.new(project).execute(scope: @scope).page(params[:page]).per(30)
+
+ @running_or_pending_count = PipelinesFinder.new(project).execute(scope: 'running').count
+ @pipelines_count = PipelinesFinder.new(project).execute.count
end
def new