0

I have a model called ModelA that I want to rename to ModelB.

I generated ModelA by doing rails g scaffold ModelA. That generated the model, controller, views, specs, routes, etc.

How do I cleanly change the name of ModelA given that I have setup associations, join tables, etc.

Also, how do I do it such that my local environment is in sync with Heroku when I push.

I feel like it is very easy to mess this up.

marcamillion
  • 32,933
  • 55
  • 189
  • 380

1 Answers1

0

If you have released your code to an environment where you can't drop tables, you will just have to hand write migrations. No out-of-the-box rails way for the same.

pungoyal
  • 1,768
  • 15
  • 17
  • It's not just about the tables. It's about that attribute being called/accessed on all the views/controllers/tests/models/etc. Is there an easy way to do that - other than 'global find & replace'? – marcamillion Jun 13 '13 at 19:55
  • afraid not! a lot depends on the code editor you are using as well. – pungoyal Jun 14 '13 at 05:09