Reputation: 19213
I'd like to run the rails "generate" script and create a model that belongs two other models. Is there a way that I can do this?
Upvotes: 3
Views: 853
Reputation: 19213
Figured it out. If you have a model named "child" that belongs to a model named "mom" and a model named "dad", the syntax is:
rails generate model child mom:reference dad:reference
Upvotes: 4