I am writing an exporter in my current Rails3 project right now. This exporter should mark each exported record as "exported" (bool). I know how to do this easily in a loop, but to be honest, it’s not very convenient to let Rails query a database, say 300 times in a row, just set one field for 300 records.
Does anyone know if there is a good way to optimize this? Should I play manually with prepared statements, or will Rails3 take care of this automatically? Is there another SQL command to do this in one step or something else?
thanks for the help
source
share