What is best way to refactor in Ruby on Rails. I have a project where i would like to refactor several of my objects – extra properties and renaming of existing properties. How do i do this this the easiest way?? I created the different objects with scaffolding “rails generate scaffold foo name:string….”
I do start from scratch or is there some cool ruby command, like “rails refactor foo name:string”..
What is best way to refactor in Ruby on Rails. I have a project
Share
As far as I am aware, there is no automated way to do this. The key things as far as I’m concerned is to make sure that your test coverage is good in the relevant area (and preferably across your whole app) before you start.
Once that’s done, I’ve tended to apply fairly brute force tactics to do that actual refactor:
The reason that refactoring isn’t very automated in Ruby (in my view at least) is because the language is so dynamic, so it’s very hard for any automated tools to make sure they’ve covered all the bases.