One of the projects we are currently working on required strict reporting: sales and transaction data for years - all this had to be exported as CSV files. Large CSV files.
Normally I could queue the export and execute it as a background process, but this time I found a quick win: using a combination of find_each ActiveRecord and Ruby Enumerator to stream CSV - in batches and directly from the controller. What do you think about it?
Wow, thanks for sharing such a tip. I usually use Coupler.io when exporting ad data to Google docs. You can find more info there if you become interested in doing it in such an easy way now. I even wonder if it was done manually back in the day. I guess if I wasn't supervised at work and helped out, that's what I would do. I don't think it would have been effective. I would quickly get bored of doing it, especially if something needs to be sent in urgently for inspection. Is there anyone like me?
-- Edited by mylesduffy on Monday 9th of May 2022 01:43:51 PM