Method: ActiveJob::Core#serialize

Defined in:
activejob/lib/active_job/core.rb

#serializeObject

Returns a hash with the job data that can safely be passed to the queuing adapter.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'activejob/lib/active_job/core.rb', line 107

def serialize
  {
    "job_class"  => self.class.name,
    "job_id"     => job_id,
    "provider_job_id" => provider_job_id,
    "queue_name" => queue_name,
    "priority"   => priority,
    "arguments"  => serialize_arguments_if_needed(arguments),
    "executions" => executions,
    "exception_executions" => exception_executions,
    "locale"     => I18n.locale.to_s,
    "timezone"   => timezone,
    "enqueued_at" => Time.now.utc.iso8601(9),
    "scheduled_at" => scheduled_at ? scheduled_at.utc.iso8601(9) : nil,
  }
end