summaryrefslogtreecommitdiff
path: root/app/models/hooks/web_hook_log.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/hooks/web_hook_log.rb')
-rw-r--r--app/models/hooks/web_hook_log.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/hooks/web_hook_log.rb b/app/models/hooks/web_hook_log.rb
new file mode 100644
index 00000000000..d73cfcf630d
--- /dev/null
+++ b/app/models/hooks/web_hook_log.rb
@@ -0,0 +1,13 @@
+class WebHookLog < ActiveRecord::Base
+ belongs_to :web_hook
+
+ serialize :request_headers, Hash # rubocop:disable Cop/ActiverecordSerialize
+ serialize :request_data, Hash # rubocop:disable Cop/ActiverecordSerialize
+ serialize :response_headers, Hash # rubocop:disable Cop/ActiverecordSerialize
+
+ validates :web_hook, presence: true
+
+ def success?
+ response_status =~ /^2/
+ end
+end