Writing a one-time script in Rails

Have you ever wanted to import a bunch of data into your app from a CSV file? Or maybe you need to fix badly encoded characters in some of your customer reviews. Or you changed your mind about how you wanted to store data in Redis, and had to move everything from the old format to the new one.

At Avvo, we called these “ad-hoc tasks.” As in, you probably only need to run them once. So what’s the best way to handle an ad-hoc task in Rails?

Write a database migration

A migration works well if yo...

 •  0 comments  •  flag
Share on Twitter
Published on February 13, 2017 22:08
No comments have been added yet.