Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Rails Migration Memory Therapy (codeclimber.blogspot.com)
4 points by eVizitei on May 25, 2009 | hide | past | favorite | 2 comments


I know this isn't very Ruby or rails specific, but if you are doing big changes to your db on big datasets and you don't use transactions, you deserve whatever comes your way.

Realize you've fucked up? A quick ROLLBACK TRANSACTION and you are safely back where you started. This is so freaking simple, I can't believe people aren't using it.


This. Model.transaction do ... end is not that hard.

Also, in Rails 2.3 you can do .find_each, which will iterate over each record in 1000-chunk batches.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: