This is a scenario I have where I'm generating multiple documents from the same context.
The problem is with images... unless I completely 'new up' the context or, alternatively, reload the Sablon::Content objects again into the context prior to passing to the next document, the images fail to render in subsequent renders because the IO context needs to be 'rewound'. The consequence is that the subsequent merge fields referencing those images come up blank.
I have a test here that demonstrates the problem. I was unable to find an appropriate place to add a rewind. I think there's some level of caching here so not sure the best place to put something like source.rewind if source.respond_to?(:rewind)
This is a scenario I have where I'm generating multiple documents from the same context.
The problem is with images... unless I completely 'new up' the context or, alternatively, reload the Sablon::Content objects again into the context prior to passing to the next document, the images fail to render in subsequent renders because the IO context needs to be 'rewound'. The consequence is that the subsequent merge fields referencing those images come up blank.
I have a test here that demonstrates the problem. I was unable to find an appropriate place to add a
rewind
. I think there's some level of caching here so not sure the best place to put something likesource.rewind if source.respond_to?(:rewind)