summaryrefslogtreecommitdiff
path: root/app/models/ci/runner.rb
diff options
context:
space:
mode:
authorKamil TrzciƄski <ayufan@ayufan.eu>2018-05-28 12:49:08 +0200
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-31 10:56:41 +0200
commitc6e95b04405f1e07f76505b03c6c096f4c4d084b (patch)
treec1d36122def40f8b0912b822bfcab764d646f39b /app/models/ci/runner.rb
parentd9251f2ea047d359d1d7d4799d1ba84da5896f64 (diff)
downloadgitlab-ce-c6e95b04405f1e07f76505b03c6c096f4c4d084b.tar.gz
Improve `Ci::Runner#assign_to` to return a flag whether it succeeded or not
Diffstat (limited to 'app/models/ci/runner.rb')
-rw-r--r--app/models/ci/runner.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 5cec88660f8..e2a1c9fb929 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -120,9 +120,8 @@ module Ci
raise ArgumentError, 'Transitioning a group runner to a project runner is not supported'
end
- runner_project = project.runner_projects.create(runner_id: self.id)
- self.save!
- runner_project
+ self.projects << project
+ self.save
end
def display_name