diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-15 15:41:46 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-15 15:41:46 +0300 |
commit | 70c0a76cad4c7ce5656c97ac81b4caa21318e961 (patch) | |
tree | f40697d9ecb70507ebcbf73e4890535c6a419e72 /app/controllers/projects/pipelines_controller.rb | |
parent | 01c8499a791a9179a0ae875ad26a1fa125e7fe4c (diff) |
Fix rubocop offenses in code related to pipelines
Diffstat (limited to 'app/controllers/projects/pipelines_controller.rb')
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 7179f3b22ea..642651101f0 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -7,25 +7,32 @@ class Projects::PipelinesController < Projects::ApplicationController def index @scope = params[:scope] - @pipelines = PipelinesFinder.new(project).execute(scope: @scope).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 + @running_or_pending_count = PipelinesFinder + .new(project).execute(scope: 'running').count + + @pipelines_count = PipelinesFinder + .new(project).execute.count respond_to do |format| format.html format.json do - render json: { - pipelines: PipelineSerializer - .new(project: @project, user: @current_user) - .with_pagination(request, response) - .represent(@pipelines), - updated_at: Time.now.utc, - count: { - all: @pipelines_count, - running_or_pending: @running_or_pending_count - } - } + render json: { + pipelines: PipelineSerializer + .new(project: @project, user: @current_user) + .with_pagination(request, response) + .represent(@pipelines), + updated_at: Time.now.utc, + count: { + all: @pipelines_count, + running_or_pending: @running_or_pending_count + } + } end end end |