Fix the update on hasmany.

This fixes a bug hasMany.