gitlab-org--gitlab-foss/app/models/hooks/web_hook.rb

16 lines
391 B
Ruby
Raw Normal View History

class WebHook < ActiveRecord::Base
include Sortable
has_many :web_hook_logs, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
2015-12-01 18:45:36 -05:00
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