* Add test
* Fix crash when encountering invalid account fields
end
def fields
- (self[:fields] || []).map { |f| Field.new(self, f) }
+ (self[:fields] || []).map do |f|
+ Field.new(self, f)
+ rescue
+ nil
+ end.compact
end
def fields_attributes=(attributes)
attachment: [
{ type: 'PropertyValue', name: 'Pronouns', value: 'They/them' },
{ type: 'PropertyValue', name: 'Occupation', value: 'Unit test' },
+ { type: 'PropertyValue', name: 'non-string', value: ['foo', 'bar'] },
],
}.with_indifferent_access
end