Permalink
Browse files

use registered services

  • Loading branch information...
1 parent f4072fd commit 18b6874865f2d26cf81804738be85977a8400d2a @svenfuchs svenfuchs committed Nov 24, 2012
@@ -14,14 +14,14 @@ def index
end
def update
- repository.service_hook.set(params[:active] == 'true', current_user)
+ run_service(:update_hook, id: repository.id, active: params[:active] == 'true')
respond_with(repository)
end
private
def service_hooks
- @service_hooks ||= current_user.service_hooks(:owner_name => params[:owner_name])
+ @service_hooks ||= run_service(:find_hooks, params)
end
def repository
@@ -13,7 +13,7 @@
def update_payload(active)
{
:name => 'travis',
- :events => ServiceHook::EVENTS,
+ :events => Travis::Github::Services::SetHook::EVENTS,
:active => active,
:config => { :user => user.login, :token => user.tokens.first.token, :domain => 'staging.travis-ci.org' }
}

0 comments on commit 18b6874

Please sign in to comment.