diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-03-02 15:14:13 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2017-08-28 17:40:25 +0300 |
commit | e80313f9ee5b3495a8713e6ddae111bc8106155b (patch) | |
tree | f1327448ef9e837aedb9fde9a50d6531e42a6112 /lib/api/runner.rb | |
parent | 998afa5f74558be215a924d95aa131a69831ca43 (diff) |
Conditionally destroy a ressource
Diffstat (limited to 'lib/api/runner.rb')
-rw-r--r-- | lib/api/runner.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb index 88fc62d33df..daa8ddbe251 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -45,8 +45,10 @@ module API end delete '/' do authenticate_runner! - status 204 - Ci::Runner.find_by_token(params[:token]).destroy + + runner = Ci::Runner.find_by_token(params[:token]) + + destroy_conditionally!(runner) end desc 'Validates authentication credentials' do |