2020-06-16 22:10:54 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Un registro de cualquier cosa, nos sirve para debuguear
|
|
|
|
# selectivamente.
|
|
|
|
class LogEntry < ApplicationRecord
|
|
|
|
belongs_to :site
|
|
|
|
serialize :text, JSON
|
|
|
|
|
|
|
|
default_scope -> { order(created_at: :desc) }
|
2020-08-20 17:21:35 +00:00
|
|
|
|
|
|
|
def resend
|
|
|
|
return if sent
|
|
|
|
|
2020-09-29 21:22:28 +00:00
|
|
|
ContactJob.perform_async site_id, params[:form], params
|
2020-08-20 17:21:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def params
|
|
|
|
@params ||= text&.dig('params')&.symbolize_keys
|
|
|
|
end
|
2020-06-16 22:10:54 +00:00
|
|
|
end
|