All threads / Many-to-Many associations break in background job
Ask A Question

Notifications

You’re not receiving notifications from this thread.

Many-to-Many associations break in background job

Criss Frost asked in Rails

I have a function in my app that emails out a PDF of any invoice as an attachment. Everything works fine if its run in production on the web worker. Of course this bogs the app down and I want to run this in background. When I move it to a background job using ActiveJob, the job fails with an Uninitialized Constant error on a many-to-many relationship. I've been chasing this in circles. Any help is appreciated.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.