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>
I figured out the following way:
1, generate migration file:
rails generate migration rename_cars_to_trains
edit the created migration file to:
class RenameCarsToTrains < ActiveRecord::Migration
def self.up
rename_table :cars, :trains
end
def self.down
rename_table :trains, :cars
end
end
rake db:migrate
After these steps, the table name changed from cars to trains, then, I have to manually change the controller and views names and the associations...
If you have any more efficient way, let me know...