Reputation: 10215
I am trying to pass the view_context
object to a background worker:
invoices = current_user.invoices
ArchiveInvoicesJob.perform_later(invoices.pluck(:id), view_context)
I understand that I cannot pass ActiveRecord:Relations
to ActiveJob. That's why I'm passing the IDs instead.
But when I try to pass the view_context
I get an ActiveJob::SerializationError.
The problem is that I need the view_context
inside my Prawn PDF class to generate a bunch of PDFs.
How do I get it in there?
Upvotes: 1
Views: 324