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

Commit 262be7bc by Mick Hansen

feat(promises): code doc, explain that findOrCreate/findOrInitialize returns multiple arguments

1 parent d8c32ff4
Showing with 2 additions and 0 deletions
...@@ -957,6 +957,7 @@ module.exports = (function() { ...@@ -957,6 +957,7 @@ module.exports = (function() {
/** /**
* Find a row that matches the query, or build (but don't save) the row if none is found. * Find a row that matches the query, or build (but don't save) the row if none is found.
* The successfull result of the promise will be (instance, initialized) - Make sure to use .spread()
* *
* @param {Object} where A hash of search attributes. Note that this method differs from finders, in that the syntax is `{ attr1: 42 }` and NOT `{ where: { attr1: 42}}`. This may be subject to change in 2.0 * @param {Object} where A hash of search attributes. Note that this method differs from finders, in that the syntax is `{ attr1: 42 }` and NOT `{ where: { attr1: 42}}`. This may be subject to change in 2.0
* @param {Object} [defaults] Default values to use if building a new instance * @param {Object} [defaults] Default values to use if building a new instance
...@@ -1002,6 +1003,7 @@ module.exports = (function() { ...@@ -1002,6 +1003,7 @@ module.exports = (function() {
/** /**
* Find a row that matches the query, or build and save the row if none is found * Find a row that matches the query, or build and save the row if none is found
* The successfull result of the promise will be (instance, created) - Make sure to use .spread()
* *
* @param {Object} where A hash of search attributes. Note that this method differs from finders, in that the syntax is `{ attr1: 42 }` and NOT `{ where: { attr1: 42}}`. This is subject to change in 2.0 * @param {Object} where A hash of search attributes. Note that this method differs from finders, in that the syntax is `{ attr1: 42 }` and NOT `{ where: { attr1: 42}}`. This is subject to change in 2.0
* @param {Object} [defaults] Default values to use if creating a new instance * @param {Object} [defaults] Default values to use if creating a new instance
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!