在使用延迟作业时,我一直收到错误信息。
Job failed to load: `@' is not allowed as an instance variable name.在这里调用它:
report = Report.find(params[:id])
report.delay.record_fixing( report.records.where(found: nil, pending: nil) )
redirect_to reports_path记录修复是
def record_fixing(records)
records.search_fullcontact
end发布于 2014-04-29 20:36:01
此问题的原因是传递给方法record_fixing的参数,即
ActiveRelation Object(report.records.where(found: nil, pending: nil))它与方法名一起被序列化,因为延迟的作业出于某种原因这样做了,它失败了,因此引发了这个错误,并将它添加到表列last_error中,所以为了解决这种问题,我建议我们应该传递对象id而不是整个对象,并在方法record_fixing中获取该对象,这样做的想法是为序列化提供更简单的参数。
https://stackoverflow.com/questions/22623329
复制相似问题