Class: WebHookLog

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

Constant Summary

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Presentable

#present

Methods included from SafeUrl

#safe_url

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Class Method Details

.recentObject


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

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)

33
34
35
# File 'app/models/hooks/web_hook_log.rb', line 33

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

#success?Boolean

Returns:

  • (Boolean)

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

def success?
  response_status =~ /^2/
end