Class: WebHookEvent

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/web_hook_event.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.purge_oldObject



10
11
12
# File 'app/models/web_hook_event.rb', line 10

def self.purge_old
  where("created_at < ?", SiteSetting.retain_web_hook_events_period_days.days.ago).delete_all
end

Instance Method Details

#update_web_hook_delivery_statusObject



14
15
16
17
18
19
20
21
22
23
# File 'app/models/web_hook_event.rb', line 14

def update_web_hook_delivery_status
  web_hook.last_delivery_status =
    case status
    when 200..299
      WebHook.last_delivery_statuses[:successful]
    else
      WebHook.last_delivery_statuses[:failed]
    end
  web_hook.save!
end