gitlab-org--gitlab-foss/app/observers/system_hook_observer.rb
Dmitriy Zaporozhets 37ef33cba1
Use instance methods for system_hooks_service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-15 14:26:05 +02:00

17 lines
341 B
Ruby

class SystemHookObserver < BaseObserver
observe :user, :project, :users_project
def after_create(model)
system_hook_service.execute_hooks_for(model, :create)
end
def after_destroy(model)
system_hook_service.execute_hooks_for(model, :destroy)
end
private
def system_hook_service
SystemHooksService.new
end
end