diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-11-17 12:06:45 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-11-17 21:34:24 +0100 |
commit | d4def9cbcd664b7067e7f9f4ea8be54463bd1d50 (patch) | |
tree | 10c5fe56054be36687146877b4000286334e76e7 /lib/api/services.rb | |
parent | 1b4fdb9893af28606b7594ee656438c7ef21e9d8 (diff) | |
download | gitlab-ce-d4def9cbcd664b7067e7f9f4ea8be54463bd1d50.tar.gz |
Incorporate feedback, improve presenter class
[ci skip]
Diffstat (limited to 'lib/api/services.rb')
-rw-r--r-- | lib/api/services.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/api/services.rb b/lib/api/services.rb index b4b3bb6e41a..094fca49c28 100644 --- a/lib/api/services.rb +++ b/lib/api/services.rb @@ -61,6 +61,10 @@ module API end resource :projects do + + desc 'Trigger a slash command' do + detail 'Added in GitLab 8.13' + end post ':id/services/:service_slug/trigger' do project = Project.find_with_namespace(params[:id]) || Project.find_by(id: params[:id]) @@ -71,9 +75,7 @@ module API service = project.public_send(service_method) - result = if service.try(:active?) && service.respond_to?(:trigger) - service.trigger(params) - end + result = service.try(:active?) && service.try(:trigger, params) if result present result, status: result[:status] || 200 |