fix gorm writer

you cannot iterate over the properties of a gorm object without
accidentaly calling a bunch of hardcore select count(*) statements