0

I added a relationship a little while ago to users (user has many cars). But my boss has told me I need to make a new model for companies which the cars will belong to the company and the leases will reside with the company so company leases to many uses. I can't find the specific migration that added the user_id to cars, so is there a way to say modify?

rails g migration user_id_to_company_id_on_cars
tshepang
  • 12,111
  • 21
  • 91
  • 136

1 Answers1

0

Sorry, the question is hard to understand. Why should you modify rails association from command line, I think it is just belongs_to or has_many in the model?

If you want to do a migration on a model, you can do for example:

rails g migration add_user_id_to_cars user_id:integer
tshepang
  • 12,111
  • 21
  • 91
  • 136
Nich
  • 1,112
  • 1
  • 14
  • 29