I completly forgot, over night, how to create the migration for this type of relationship:
I have a project table and a user table and each user has their own projects that they create how ever users may share the project they create either upon creating or editin the project so the relation ship is:
each project may have many users and belongs to user while each user has many projects and belongs to a project.
the problem?
I am not sure how to make a migration from this >.> as I was told I need to create a new table to stipulate this relationship.
I was thinking
generate migration project_user project_id :int user_id :int
is that any where right?
You need a total of 3 tables: users, projects, and project_editor_links
Your migrations:
To generate that last table from the command-line:
Your models should look something like this: