When we first moved excel generation off to a delayed job on survey-web, we had code that looked like this:
1 2 |
|
And this would bomb with an error like Can't dump anonymous Module
.
After some time getting nowhere, we solved it like this:
1 2 |
|
And in the job:
1
|
|
While refactoring a lot of that code over the last few days, we ran into the same issue. But with one difference. A controller spec was failing, but a test for the job which also passed a bunch of responses into it passed.
We wondered if maybe it was because we were passing a relation into the job instead of an array.
So we tried:
1 2 |
|
And that worked great.