Update validations.js

Add doc of allowNull options property per #372.
This commit is contained in:
Rand McKinney 2016-09-28 16:43:17 -07:00 committed by GitHub
parent 236bb2bb16
commit 9a1ef08495
1 changed files with 9 additions and 2 deletions

View File

@ -129,9 +129,11 @@ Validatable.validatesNumericalityOf = getConfigurator('numericality');
* ```
*
* @param {String} propertyName Property name to validate.
* @options {Object} Options
* @options {Object} Options See below
* @property {Array} inArray Property must match one of the values in the array to be valid.
* @property {String} message Optional error message if property is not valid. Default error message: "is not included in the list".
* @property {String} message Optional error message if property is not valid.
* Default error message: "is not included in the list".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validatesInclusionOf = getConfigurator('inclusion');
@ -144,6 +146,7 @@ Validatable.validatesInclusionOf = getConfigurator('inclusion');
* @options {Object} Options
* @property {Array} inArray Property must match one of the values in the array to be valid.
* @property {String} message Optional error message if property is not valid. Default error message: "is reserved".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validatesExclusionOf = getConfigurator('exclusion');
@ -157,6 +160,7 @@ Validatable.validatesExclusionOf = getConfigurator('exclusion');
* @options {Object} Options
* @property {RegExp} with Regular expression to validate format.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validatesFormatOf = getConfigurator('format');
@ -178,6 +182,7 @@ Validatable.validatesFormatOf = getConfigurator('format');
* @param {Function} validatorFn Custom validation function.
* @options {Object} Options See below.
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validate = getConfigurator('custom');
@ -209,6 +214,7 @@ Validatable.validate = getConfigurator('custom');
* @param {Function} validatorFn Custom validation function.
* @options {Object} Options See below
* @property {String} message Optional error message if property is not valid. Default error message: " is invalid".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validateAsync = getConfigurator('custom', {async: true});
@ -233,6 +239,7 @@ Validatable.validateAsync = getConfigurator('custom', {async: true});
* @property {RegExp} with Regular expression to validate format.
* @property {Array.<String>} scopedTo List of properties defining the scope.
* @property {String} message Optional error message if property is not valid. Default error message: "is not unique".
* @property {Boolean} allowNull Whether null values are allowed.
*/
Validatable.validatesUniquenessOf = getConfigurator('uniqueness', {async: true});