Lighthouse has a new layout.
Prefer the old one? Return to the old layout,
and switch back any time from the link at the top of each page.
This project is archived and is in readonly mode.
Batch processing #find_each and #find_in_batches causes object references to break
#6656
While trying to implement batch processing to alleviate memory
bloat from a monolithic copy routine I discovered that I am unable
to reference an ActiveRecord object via a belongs_to relationship
even though the object id is set. Here is a basic example of what
I'm talking about (within the context of batch processing):
I've attached a patch that adds a test for the issue, but I
can't for the life of me figure out why it is happening. If the
batch processing is removed (call #each instead of #find_each) then
the problem goes away.