5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-05-19 09:40:48 +00:00

fixup! fix: serializar correctamente

This commit is contained in:
f 2024-03-13 16:27:33 -03:00
parent 56c583e0f4
commit ad9f9c3d61
No known key found for this signature in database
2 changed files with 25 additions and 0 deletions

5
app/models/que_job.rb Normal file
View file

@ -0,0 +1,5 @@
# frozen_string_literal: true
require 'que/active_record/model'
class QueJob < Que::ActiveRecord::Model; end

View file

@ -0,0 +1,20 @@
# frozen_string_literal: true
class FixFetchJobs < ActiveRecord::Migration[6.1]
def up
QueJob.where("last_error_message like '%ActiveJob::DeserializationError%'").find_each do |job|
job.error_count = 0
job.run_at = time.now
job.args.first['arguments'].first['_aj_ruby2_keywords'].delete('object')
job.args.first['arguments'].first['_aj_ruby2_keywords'] << 'object_id'
object = job.args.first['arguments'].first.delete('object')['_aj_globalid']
job.args.first['arguments'].first['object_id'] = object.split('/').last
job.save
end
end
def down; end
end