diff options
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/badges_controller.rb | 8 | ||||
-rw-r--r-- | app/controllers/projects/boards/issues_controller.rb | 8 | ||||
-rw-r--r-- | app/controllers/projects/commit_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/projects/compare_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/projects/environments_controller.rb | 22 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 28 | ||||
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 24 |
7 files changed, 50 insertions, 50 deletions
diff --git a/app/controllers/projects/badges_controller.rb b/app/controllers/projects/badges_controller.rb index c1727d9fa28..6c25cd83a24 100644 --- a/app/controllers/projects/badges_controller.rb +++ b/app/controllers/projects/badges_controller.rb @@ -4,15 +4,15 @@ class Projects::BadgesController < Projects::ApplicationController before_action :no_cache_headers, except: [:index] def build - build_status = Gitlab::Badge::Build::Status. - new(project, params[:ref]) + build_status = Gitlab::Badge::Build::Status + .new(project, params[:ref]) render_badge build_status end def coverage - coverage_report = Gitlab::Badge::Coverage::Report. - new(project, params[:ref], params[:job]) + coverage_report = Gitlab::Badge::Coverage::Report + .new(project, params[:ref], params[:job]) render_badge coverage_report end diff --git a/app/controllers/projects/boards/issues_controller.rb b/app/controllers/projects/boards/issues_controller.rb index 8bcf18642cf..61fef4dc133 100644 --- a/app/controllers/projects/boards/issues_controller.rb +++ b/app/controllers/projects/boards/issues_controller.rb @@ -40,10 +40,10 @@ module Projects def issue @issue ||= - IssuesFinder.new(current_user, project_id: project.id). - execute. - where(iid: params[:id]). - first! + IssuesFinder.new(current_user, project_id: project.id) + .execute + .where(iid: params[:id]) + .first! end def authorize_read_issue! diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 23466dda981..e10d7992db7 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -35,9 +35,9 @@ class Projects::CommitController < Projects::ApplicationController respond_to do |format| format.html format.json do - render json: PipelineSerializer. - new(project: @project, user: @current_user). - represent(@pipelines) + render json: PipelineSerializer + .new(project: @project, user: @current_user) + .represent(@pipelines) end end end diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index 99204c82784..c6651254d70 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -46,8 +46,8 @@ class Projects::CompareController < Projects::ApplicationController end def define_diff_vars - @compare = CompareService.new(@project, @head_ref). - execute(@project, @start_ref) + @compare = CompareService.new(@project, @head_ref) + .execute(@project, @start_ref) if @compare @commits = @compare.commits diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb index 2bbd8c6d046..fed75396d6e 100644 --- a/app/controllers/projects/environments_controller.rb +++ b/app/controllers/projects/environments_controller.rb @@ -9,18 +9,18 @@ class Projects::EnvironmentsController < Projects::ApplicationController before_action :verify_api_request!, only: :terminal_websocket_authorize def index - @environments = project.environments. - with_state(params[:scope] || :available) + @environments = project.environments + .with_state(params[:scope] || :available) respond_to do |format| format.html format.json do render json: { - environments: EnvironmentSerializer. - new(project: @project, user: @current_user). - with_pagination(request, response). - within_folders. - represent(@environments), + environments: EnvironmentSerializer + .new(project: @project, user: @current_user) + .with_pagination(request, response) + .within_folders + .represent(@environments), available_count: project.environments.available.count, stopped_count: project.environments.stopped.count } @@ -36,10 +36,10 @@ class Projects::EnvironmentsController < Projects::ApplicationController format.html format.json do render json: { - environments: EnvironmentSerializer. - new(project: @project, user: @current_user). - with_pagination(request, response). - represent(@environments), + environments: EnvironmentSerializer + .new(project: @project, user: @current_user) + .with_pagination(request, response) + .represent(@environments), available_count: folder_environments.available.count, stopped_count: folder_environments.stopped.count } diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 5ee7972e29e..d122c7fdcb2 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -232,9 +232,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController end format.json do - render json: PipelineSerializer. - new(project: @project, user: @current_user). - represent(@pipelines) + render json: PipelineSerializer + .new(project: @project, user: @current_user) + .represent(@pipelines) end end end @@ -245,9 +245,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController format.json do define_pipelines_vars - render json: PipelineSerializer. - new(project: @project, user: @current_user). - represent(@pipelines) + render json: PipelineSerializer + .new(project: @project, user: @current_user) + .represent(@pipelines) end end end @@ -332,9 +332,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController return access_denied! end - MergeRequests::MergeWhenPipelineSucceedsService. - new(@project, current_user). - cancel(@merge_request) + MergeRequests::MergeWhenPipelineSucceedsService + .new(@project, current_user) + .cancel(@merge_request) end def merge @@ -361,9 +361,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController end if @merge_request.head_pipeline.active? - MergeRequests::MergeWhenPipelineSucceedsService. - new(@project, current_user, merge_params). - execute(@merge_request) + MergeRequests::MergeWhenPipelineSucceedsService + .new(@project, current_user, merge_params) + .execute(@merge_request) @status = :merge_when_build_succeeds elsif @merge_request.head_pipeline.success? @@ -640,8 +640,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def merge_request_params - params.require(:merge_request). - permit(merge_request_params_ce) + params.require(:merge_request) + .permit(merge_request_params_ce) end def merge_request_params_ce diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 0f2b7b2a4c8..e436c6666c3 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -7,11 +7,11 @@ 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_count = PipelinesFinder. .new(project).execute(scope: 'running').count @@ -29,10 +29,10 @@ class Projects::PipelinesController < Projects::ApplicationController format.html format.json do render json: { - pipelines: PipelineSerializer. - new(project: @project, user: @current_user). - with_pagination(request, response). - represent(@pipelines), + pipelines: PipelineSerializer + .new(project: @project, user: @current_user) + .with_pagination(request, response) + .represent(@pipelines), count: { all: @pipelines_count, running: @running_count, @@ -49,9 +49,9 @@ class Projects::PipelinesController < Projects::ApplicationController end def create - @pipeline = Ci::CreatePipelineService. - new(project, current_user, create_params). - execute(ignore_skip_ci: true, save_on_errors: false) + @pipeline = Ci::CreatePipelineService + .new(project, current_user, create_params) + .execute(ignore_skip_ci: true, save_on_errors: false) unless @pipeline.persisted? render 'new' return |