I have 3 tables users
, roles
and roles_users
. The roles_users
table have user_id
and role_id
Now my models are Model_User
, Model_Role
, Model_User_Role
.
How can i link the three models so that every user is associated to one role and one role has many users.
I am using ORM and i want to display the list of users with the name of there role.
Note: The table i have taken from Auth
Module of Kohana.