Order HABTM tables using both ids