不要怂,就是干,撸起袖子干!

Commit 001560dd by Thiago Sigrist

fix addAssociations() docs: null arg does nothing

1 parent a4d56f30
...@@ -74,9 +74,9 @@ Associate several instances with this. ...@@ -74,9 +74,9 @@ Associate several instances with this.
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| [newAssociations] | Array.<Instance | String | Number> | An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. | | [newAssociations] | Array.<Instance | String | Number> | An array of instances or primary key of instances to associate with this. |
| [options] | Object | Options passed to `through.findAll`, `bulkCreate`, and `update` `destroy`. Can also hold additional attributes for the join table | | [options] | Object | Options passed to `through.findAll`, `bulkCreate` and `update`. Can also hold additional attributes for the join table. |
| [options.validate] | Object | Run validation for the join model | | [options.validate] | Object | Run validation for the join model. |
*** ***
...@@ -85,15 +85,15 @@ Associate several instances with this. ...@@ -85,15 +85,15 @@ Associate several instances with this.
## `addAssociation([newAssociation], [options])` -> `Promise` ## `addAssociation([newAssociation], [options])` -> `Promise`
[View code](https://github.com/sequelize/sequelize/blob/0de404640d4c71e2d1f1259356650dfb586a248b/lib/associations/belongs-to-many.js#L239) [View code](https://github.com/sequelize/sequelize/blob/0de404640d4c71e2d1f1259356650dfb586a248b/lib/associations/belongs-to-many.js#L239)
Associate several instances with this. Associate one instance with this.
**Params:** **Params:**
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| [newAssociation] | Instance | String | Number | An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. | | [newAssociation] | Instance | String | Number | An instance or primary key of instance to associate with this. |
| [options] | Object | Options passed to `through.findAll`, `bulkCreate` and `update`. Can also hold additional attributes for the join table | | [options] | Object | Options passed to `through.findAll`, `bulkCreate` and `update`. Can also hold additional attributes for the join table. |
| [options.validate] | Object | Run validation for the join model | | [options.validate] | Object | Run validation for the join model. |
*** ***
......
...@@ -53,9 +53,9 @@ Associate several instances with this. ...@@ -53,9 +53,9 @@ Associate several instances with this.
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| [newAssociations] | Array.<Instance | String | Number> | An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. | | [newAssociations] | Array.<Instance | String | Number> | An array of instances or primary key of instances to associate with this. |
| [options] | Object | Options passed to `target.update`. | | [options] | Object | Options passed to `target.update`. |
| [options.validate] | Object | Run validation for the join model | | [options.validate] | Object | Run validation for the join model. |
*** ***
...@@ -64,15 +64,15 @@ Associate several instances with this. ...@@ -64,15 +64,15 @@ Associate several instances with this.
## `addAssociation([newAssociation], [options])` -> `Promise` ## `addAssociation([newAssociation], [options])` -> `Promise`
[View code](https://github.com/sequelize/sequelize/blob/0de404640d4c71e2d1f1259356650dfb586a248b/lib/associations/has-many.js#L134) [View code](https://github.com/sequelize/sequelize/blob/0de404640d4c71e2d1f1259356650dfb586a248b/lib/associations/has-many.js#L134)
Associate several instances with this. Associate one instance with this.
**Params:** **Params:**
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| [newAssociation] | Instance | String | Number | An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. | | [newAssociation] | Instance | String | Number | An instance or primary key of instance to associate with this. |
| [options] | Object | Options passed to `target.update`. | | [options] | Object | Options passed to `target.update`. |
| [options.validate] | Object | Run validation for the join model | | [options.validate] | Object | Run validation for the join model. |
*** ***
......
...@@ -220,19 +220,19 @@ var BelongsToMany = function(source, target, options) { ...@@ -220,19 +220,19 @@ var BelongsToMany = function(source, target, options) {
/** /**
* Associate several instances with this. * Associate several instances with this.
* *
* @param {Array<Instance|String|Number>} [newAssociations] An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. * @param {Array<Instance|String|Number>} [newAssociations] An array of instances or primary key of instances to associate with this.
* @param {Object} [options] Options passed to `through.findAll`, `bulkCreate`, and `update` `destroy`. Can also hold additional attributes for the join table * @param {Object} [options] Options passed to `through.findAll`, `bulkCreate` and `update`. Can also hold additional attributes for the join table.
* @param {Object} [options.validate] Run validation for the join model * @param {Object} [options.validate] Run validation for the join model.
* @return {Promise} * @return {Promise}
* @method addAssociations * @method addAssociations
*/ */
addMultiple: 'add' + plural, addMultiple: 'add' + plural,
/** /**
* Associate several instances with this. * Associate one instance with this.
* *
* @param {Instance|String|Number} [newAssociation] An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. * @param {Instance|String|Number} [newAssociation] An instance or primary key of instance to associate with this.
* @param {Object} [options] Options passed to `through.findAll`, `bulkCreate` and `update`. Can also hold additional attributes for the join table * @param {Object} [options] Options passed to `through.findAll`, `bulkCreate` and `update`. Can also hold additional attributes for the join table.
* @param {Object} [options.validate] Run validation for the join model * @param {Object} [options.validate] Run validation for the join model.
* @return {Promise} * @return {Promise}
* @method addAssociation * @method addAssociation
*/ */
......
...@@ -115,19 +115,19 @@ var HasMany = function(source, target, options) { ...@@ -115,19 +115,19 @@ var HasMany = function(source, target, options) {
/** /**
* Associate several instances with this. * Associate several instances with this.
* *
* @param {Array<Instance|String|Number>} [newAssociations] An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. * @param {Array<Instance|String|Number>} [newAssociations] An array of instances or primary key of instances to associate with this.
* @param {Object} [options] Options passed to `target.update`. * @param {Object} [options] Options passed to `target.update`.
* @param {Object} [options.validate] Run validation for the join model * @param {Object} [options.validate] Run validation for the join model.
* @return {Promise} * @return {Promise}
* @method addAssociations * @method addAssociations
*/ */
addMultiple: 'add' + plural, addMultiple: 'add' + plural,
/** /**
* Associate several instances with this. * Associate one instance with this.
* *
* @param {Instance|String|Number} [newAssociation] An array of instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations. * @param {Instance|String|Number} [newAssociation] An instance or primary key of instance to associate with this.
* @param {Object} [options] Options passed to `target.update`. * @param {Object} [options] Options passed to `target.update`.
* @param {Object} [options.validate] Run validation for the join model * @param {Object} [options.validate] Run validation for the join model.
* @return {Promise} * @return {Promise}
* @method addAssociation * @method addAssociation
*/ */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!