Creating many-to-many relationships with an intermediary model