Sorry if this is a simple question, I haven’t had much luck with the search terms I’ve been using…
In my rails 3 project I have the models Project, User and UserProjectRole.
a User has many Projects, as well as a role for each project that is defined in UserProjectRole (which contains a user_id, project_id, and role).
There are 2 roles: editor and lead.
If I want to group the list of projects so current_user sees the projects they lead listed first, the projects they can edit listed second, and the projects for which they have no role listed last, how can I do this?
Thanks in advance.
Here is one method: