Refactazor

Renaming a model in a large rails app? Refactazor is for you!

USAGE


$ refactazor template category

To rename Template to Category, for example. After you’ve made the code changes, you can get the body of a migration (if you renamed a model for example) by choosing ‘m’

This will dump out the body of a migration which should help take care of your table and column names affected.

Disclaimer

Do this in a new branch or something, whatever you do don’t use it on a project which is not in version control. You will probably regret it if you can’t undo anything. No warranty.

This script is to reduce the typing involved in such a refactor. It is not supposed to think for you. There will be more work for you to do after you’ve successfuly run it, this is just to speed the process up a bit.

I have, however, used this script to rename a model appearing in hundreds of files in a large app in a relatively short amount of time.

On Github