Skip to content

Commit

Permalink
Dont call as_json on Delayed::Backend::Sequel::Job
Browse files Browse the repository at this point in the history
  instead call #to_hash, and turn all the keys to strings, to
  keep the rest of the implementation untouched
  • Loading branch information
davidbegin committed May 24, 2016
1 parent 50b4778 commit df4d175
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/rollbar/plugins/delayed_job/job_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ def initialize(job)
end

def to_hash
job_data = job.as_json
job_data = if job.respond_to?(:as_json)
job.as_json
else
Hash[job.to_hash.map{ |k, v| [k.to_s, v] }]
end

handler_parent = job_data['job'] ? job_data['job'] : job_data
handler_parent['handler'] = handler_data

Expand Down

0 comments on commit df4d175

Please sign in to comment.