Criss Frost


150 Experience
1 Lesson Completed
0 Questions Solved


Posted in Many-to-Many associations break in background job

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.

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

© 2023 GoRails, LLC. All rights reserved.