diff options
| author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-05-28 12:49:08 +0200 |
|---|---|---|
| committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-31 10:56:41 +0200 |
| commit | c6e95b04405f1e07f76505b03c6c096f4c4d084b (patch) | |
| tree | c1d36122def40f8b0912b822bfcab764d646f39b /lib/api | |
| parent | d9251f2ea047d359d1d7d4799d1ba84da5896f64 (diff) | |
| download | gitlab-ce-c6e95b04405f1e07f76505b03c6c096f4c4d084b.tar.gz | |
Improve `Ci::Runner#assign_to` to return a flag whether it succeeded or not
Diffstat (limited to 'lib/api')
| -rw-r--r-- | lib/api/runners.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb index 5cb96d467c0..d9a42960cb6 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -133,9 +133,7 @@ module API runner = get_runner(params[:runner_id]) authenticate_enable_runner!(runner) - runner_project = runner.assign_to(user_project) - - if runner_project.persisted? + if runner.assign_to(user_project) present runner, with: Entities::Runner else conflict!("Runner was already enabled for this project") |
