Fix error messages, should be lowercase
This commit is contained in:
parent
7698f0f08b
commit
170dc661f4
|
@ -1853,7 +1853,7 @@ RelationDefinition.embedsMany = function embedsMany(modelFrom, modelTo, params)
|
|||
return ids.indexOf(id) === pos;
|
||||
});
|
||||
if (ids.length !== uniqueIds.length) {
|
||||
this.errors.add(propertyName, 'Contains duplicate `' + idName + '`', 'uniqueness');
|
||||
this.errors.add(propertyName, 'contains duplicate `' + idName + '`', 'uniqueness');
|
||||
err(false);
|
||||
}
|
||||
}, { code: 'uniqueness' })
|
||||
|
@ -1877,7 +1877,7 @@ RelationDefinition.embedsMany = function embedsMany(modelFrom, modelTo, params)
|
|||
}
|
||||
} else {
|
||||
hasErrors = true;
|
||||
self.errors.add(propertyName, 'Contains invalid item', 'invalid');
|
||||
self.errors.add(propertyName, 'contains invalid item', 'invalid');
|
||||
}
|
||||
});
|
||||
if (hasErrors) err(false);
|
||||
|
@ -2325,7 +2325,7 @@ RelationDefinition.referencesMany = function referencesMany(modelFrom, modelTo,
|
|||
return ids.indexOf(id) === pos;
|
||||
});
|
||||
if (ids.length !== uniqueIds.length) {
|
||||
var msg = 'Contains duplicate `' + modelTo.modelName + '` instance';
|
||||
var msg = 'contains duplicate `' + modelTo.modelName + '` instance';
|
||||
this.errors.add(relationName, msg, 'uniqueness');
|
||||
err(false);
|
||||
}
|
||||
|
|
|
@ -2411,7 +2411,7 @@ describe('relations', function () {
|
|||
err.name.should.equal('ValidationError');
|
||||
err.details.codes.jobs.should.eql(['uniqueness']);
|
||||
var expected = 'The `Category` instance is not valid. ';
|
||||
expected += 'Details: `jobs` Contains duplicate `Job` instance.';
|
||||
expected += 'Details: `jobs` contains duplicate `Job` instance.';
|
||||
err.message.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue