Fixed saving habtm relationships when using a custom foreign key field