diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-17 16:03:12 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-02-17 16:03:12 +0300 |
commit | f662bc5a866dc24580caa48952f25061bae60d1a (patch) | |
tree | 1cd3c637b0581056aa9ce608e08b974e870a4607 /lib | |
parent | 5cc9ebbe14ce35de1ec45fc7abce3aa9f408ddf2 (diff) | |
parent | 60288d6c62d7e65ed5a93a72ba047ccaa2daa22b (diff) |
Merge branch 'use-update-runner-service' into 'master'
Prefer service object over after_save hook
Closes #26921
See merge request !8664
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/runners.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb index 4816b5ed1b7..4fbd4096533 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -60,8 +60,9 @@ module API put ':id' do runner = get_runner(params.delete(:id)) authenticate_update_runner!(runner) + update_service = Ci::UpdateRunnerService.new(runner) - if runner.update(declared_params(include_missing: false)) + if update_service.update(declared_params(include_missing: false)) present runner, with: Entities::RunnerDetails, current_user: current_user else render_validation_error!(runner) |