Class: Fuik::WebhookEvent

Inherits:
ApplicationRecord show all
Includes:
Filterable
Defined in:
app/models/fuik/webhook_event.rb,
app/models/fuik/webhook_event/filterable.rb

Defined Under Namespace

Modules: Filterable

Instance Method Summary collapse

Instance Method Details

#failed!(error) ⇒ Object



24
25
26
# File 'app/models/fuik/webhook_event.rb', line 24

def failed!(error)
  update!(status: "failed", error: error.to_s)
end

#payloadObject



14
15
16
17
18
# File 'app/models/fuik/webhook_event.rb', line 14

def payload
  @payload ||= JSON.parse(body)
rescue JSON::ParserError
  {}
end

#processed!Object



20
21
22
# File 'app/models/fuik/webhook_event.rb', line 20

def processed!
  update!(status: "processed")
end