diff options
author | Alexander Randa <randa.alex@gmail.com> | 2017-07-20 18:12:06 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-20 18:12:06 +0300 |
commit | e0ab5618a0998175df9f90c95ebd35d7afa01db7 (patch) | |
tree | 91cfff5c3c9f6a118d69df5e2816b7461ce2ccc5 /app/models/hooks/system_hook.rb | |
parent | 020b6a0be06614815d96854084f3dcafeefcf0b7 (diff) |
Wrong data type when testing webhooks
Diffstat (limited to 'app/models/hooks/system_hook.rb')
-rw-r--r-- | app/models/hooks/system_hook.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/hooks/system_hook.rb b/app/models/hooks/system_hook.rb index 1584235ab00..180c479c41b 100644 --- a/app/models/hooks/system_hook.rb +++ b/app/models/hooks/system_hook.rb @@ -1,5 +1,13 @@ class SystemHook < WebHook - scope :repository_update_hooks, -> { where(repository_update_events: true) } + TRIGGERS = { + repository_update_hooks: :repository_update_events, + push_hooks: :push_events, + tag_push_hooks: :tag_push_events + }.freeze + + TRIGGERS.each do |trigger, event| + scope trigger, -> { where(event => true) } + end default_value_for :push_events, false default_value_for :repository_update_events, true |