How to re-name a ActiveRecord Model which can automatically change the table name in DB?

后端 未结 4 1373
野趣味
野趣味 2021-02-04 05:21

I have a Active Record model \"car\", I would like to change the name of this model to \"train\" without changing functionalities inside, that\'s only

4条回答
  •  离开以前
    2021-02-04 05:54

    If you're using RubyMine, go into the model, right click the class name > refactor and change the name. RubyMine will refactor everything and create a new migration for the database as well.

提交回复
热议问题