From f12faae8b841189fb3f8693fc4880fdb9688b5d2 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 18 Jul 2016 18:42:03 +0200 Subject: [PATCH] Improve code design --- app/controllers/projects/builds_controller.rb | 8 ++------ db/fixtures/development/14_builds.rb | 2 +- doc/ci/yaml/README.md | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb index d64d1e52e2c..553b62741a5 100644 --- a/app/controllers/projects/builds_controller.rb +++ b/app/controllers/projects/builds_controller.rb @@ -49,18 +49,14 @@ class Projects::BuildsController < Projects::ApplicationController end def retry - unless @build.retryable? - return render_404 - end + return render_404 unless @build.retryable? build = Ci::Build.retry(@build, current_user) redirect_to build_path(build) end def play - unless @build.playable? - return render_404 - end + return render_404 unless @build.playable? build = @build.play(current_user) redirect_to build_path(build) diff --git a/db/fixtures/development/14_builds.rb b/db/fixtures/development/14_builds.rb index 44f8a61d608..124704cb451 100644 --- a/db/fixtures/development/14_builds.rb +++ b/db/fixtures/development/14_builds.rb @@ -1,5 +1,5 @@ class Gitlab::Seeder::Builds - STAGES = %w(build notify_build test notify_test deploy notify_deploy) + STAGES = %w[build notify_build test notify_test deploy notify_deploy] def initialize(project) @project = project diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index b421bbdec3f..143d2f175ef 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -530,7 +530,7 @@ The above script will: 1. Execute `cleanup_build_job` only when `build_job` fails 2. Always execute `cleanup_job` as the last step in pipeline -3. Allow you to manually execute `deploy_job` form GitLab +3. Allow you to manually execute `deploy_job` from GitLab #### Manual actions