code: function(flat) {
      return this.transform(function(acc, val, key) {
        var json = val.toJSON();
        acc[key] = flat && _.isArray(json) ? json[0] : json
      }, {});
    }
docs: Creates a JSON object of the validations, if `true` is passed - it will flatten the error into a single value per item.