Fix bug in hasMany.set when models have custom primary keys