diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-05-19 21:27:52 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-05-19 22:01:53 +0200 |
commit | 4cc77c3bf8ef72d1b08160da9f55eb1c5f95e832 (patch) | |
tree | cb095884c8ff6e6ab71b3dfe8d018cccdb7e4611 /app | |
parent | c3c503d259bbf4691f0fb24fcd713ec5b4474e61 (diff) | |
download | gitlab-ce-4cc77c3bf8ef72d1b08160da9f55eb1c5f95e832.tar.gz |
Minor runner-related code refactorings
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/runners_controller.rb | 19 | ||||
-rw-r--r-- | app/views/projects/runners/_form.html.haml | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/app/controllers/admin/runners_controller.rb b/app/controllers/admin/runners_controller.rb index a164209455b..7345c91f67d 100644 --- a/app/controllers/admin/runners_controller.rb +++ b/app/controllers/admin/runners_controller.rb @@ -9,17 +9,18 @@ class Admin::RunnersController < Admin::ApplicationController end def show - set_builds_and_projects + assign_builds_and_projects end def update - unless @runner.update_attributes(runner_params) - set_builds_and_projects and return render 'show' - end - - respond_to do |format| - format.js - format.html { redirect_to admin_runner_path(@runner) } + if @runner.update_attributes(runner_params) + respond_to do |format| + format.js + format.html { redirect_to admin_runner_path(@runner) } + end + else + assign_builds_and_projects + render 'show' end end @@ -55,7 +56,7 @@ class Admin::RunnersController < Admin::ApplicationController params.require(:runner).permit(Ci::Runner::FORM_EDITABLE) end - def set_builds_and_projects + def assign_builds_and_projects @builds = runner.builds.order('id DESC').first(30) @projects = if params[:search].present? diff --git a/app/views/projects/runners/_form.html.haml b/app/views/projects/runners/_form.html.haml index b8fe0a98107..d62f5c8f131 100644 --- a/app/views/projects/runners/_form.html.haml +++ b/app/views/projects/runners/_form.html.haml @@ -11,7 +11,7 @@ .col-sm-10 .checkbox = f.check_box :run_untagged - %span.light Indicates whether runner can pick jobs without tags + %span.light Indicates whether this runner can pick jobs without tags .form-group = label_tag :token, class: 'control-label' do Token |