gitlab-org--gitlab-foss/app/models/hooks/web_hook.rb
2017-07-20 15:12:06 +00:00

15 lines
391 B
Ruby

class WebHook < ActiveRecord::Base
include Sortable
has_many :web_hook_logs, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
validates :url, presence: true, url: true
def execute(data, hook_name)
WebHookService.new(self, data, hook_name).execute
end
def async_execute(data, hook_name)
WebHookService.new(self, data, hook_name).async_execute
end
end