diff options
author | Gabriel Mazetto <gabriel@gitlab.com> | 2016-04-15 08:08:22 -0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-04-19 11:00:30 +0200 |
commit | ee1090e2b2bc7b3762f6e2775f3fd15e92ae212b (patch) | |
tree | 9df863f27349ca2a95d0e6f16d99b85d4806d992 /app/models/hooks | |
parent | 53a1d705fe536ad373faa77ba1ef5196ff49a98b (diff) | |
download | gitlab-ce-ee1090e2b2bc7b3762f6e2775f3fd15e92ae212b.tar.gz |
Added System Hooks for push and tag_push
Code is based on Project Webhooks, removing deprecations and without
commits listing.
Diffstat (limited to 'app/models/hooks')
-rw-r--r-- | app/models/hooks/system_hook.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/hooks/system_hook.rb b/app/models/hooks/system_hook.rb index c147d8762a9..bacd42ec60a 100644 --- a/app/models/hooks/system_hook.rb +++ b/app/models/hooks/system_hook.rb @@ -19,4 +19,10 @@ # class SystemHook < WebHook + scope :push_hooks, -> { where(push_events: true) } + scope :tag_push_hooks, -> { where(tag_push_events: true) } + + def async_execute(data, hook_name) + Sidekiq::Client.enqueue(SystemHookWorker, id, data, hook_name) + end end |