debian-mirror-gitlab/app/models/hooks/system_hook.rb
2017-09-10 17:25:29 +05:30

14 lines
385 B
Ruby

class SystemHook < WebHook
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
end