Add associations:

-User has_many repos
-User has_many doc, through repos
-repo belongs_to user
-docs belongs_to repo