summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-03 19:46:59 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-03 19:46:59 +0300
commitd7204d73a9ad0ea44fb1a2b51e6944c0461a2c39 (patch)
tree93b9f7a01894379b72e090fe56459caf38a495c1 /lib/api/helpers.rb
parent94ae27312ad5816e8efc8d228faceb1d144e98ae (diff)
downloadgitlab-ci-d7204d73a9ad0ea44fb1a2b51e6944c0461a2c39.tar.gz
You should add runners to project. WHen runner added -> deploy key for runner added to gitlab project
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 783a91a..f76b039 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -5,7 +5,11 @@ module API
end
def authenticate_runner!
- forbidden! unless Runner.find_by_token(params[:token])
+ forbidden! unless current_runner
+ end
+
+ def current_runner
+ @runner ||= Runner.find_by_token(params[:token])
end
# Checks the occurrences of required attributes, each attribute must be present in the params hash