fix enum validation when type is array

fix enum validation when attribute is of type 'array'
before the fix indexOf was used to compare the whole value of the field but since the value is an array ['item1', 'item2'], it would end  up looking for the whole piece ['item1', 'item2'] instead of examing each item in the value array.