Class: WebHookLog

Inherits:
ApplicationRecord show all
Includes:
CreatedAtFilterable, DeleteWithLimit, Presentable, SafeUrl
Defined in:
app/models/hooks/web_hook_log.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Presentable

#present

Methods included from SafeUrl

#safe_url

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.recentObject


19
20
21
22
# File 'app/models/hooks/web_hook_log.rb', line 19

def self.recent
  where('created_at >= ?', 2.days.ago.beginning_of_day)
    .order(created_at: :desc)
end

Instance Method Details

#internal_error?Boolean

Returns:

  • (Boolean)

28
29
30
# File 'app/models/hooks/web_hook_log.rb', line 28

def internal_error?
  response_status == WebHookService::InternalErrorResponse::ERROR_MESSAGE
end

#success?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'app/models/hooks/web_hook_log.rb', line 24

def success?
  response_status =~ /^2/
end