summaryrefslogtreecommitdiff
path: root/lib/ci/api/helpers.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-01-28 15:12:24 +0100
committerDouwe Maan <douwe@selenight.nl>2016-01-28 15:12:24 +0100
commitb7ec476205173b9ca1780843ceb4617fdde0b9d7 (patch)
tree85e3c3e5012eefc78b51823b1c45185df447b720 /lib/ci/api/helpers.rb
parent30b0d06e9f74f0068926314ec03b003fbd86c8f2 (diff)
parent9bf47f06ab69a1592cec87825aaaf5bb4adec464 (diff)
downloadgitlab-ce-mr-merge-base.tar.gz
Merge branch 'master' into mr-merge-basemr-merge-base
Diffstat (limited to 'lib/ci/api/helpers.rb')
-rw-r--r--lib/ci/api/helpers.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb
index 1c91204e98c..199d62d9b8a 100644
--- a/lib/ci/api/helpers.rb
+++ b/lib/ci/api/helpers.rb
@@ -34,10 +34,14 @@ module Ci
@runner ||= Runner.find_by_token(params[:token].to_s)
end
- def update_runner_info
+ def get_runner_version_from_params
return unless params["info"].present?
- info = attributes_for_keys(["name", "version", "revision", "platform", "architecture"], params["info"])
- current_runner.update(info)
+ attributes_for_keys(["name", "version", "revision", "platform", "architecture"], params["info"])
+ end
+
+ def update_runner_info
+ current_runner.assign_attributes(get_runner_version_from_params)
+ current_runner.save if current_runner.changed?
end
def max_artifacts_size