summaryrefslogtreecommitdiff
path: root/app/models/hooks/web_hook_log.rb
blob: d73cfcf630de986dbdb704c04543a983b8848740 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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