Fixing primary key assignment for habtm association