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

Commit c4ee8dd5 by Trey Thomas

Fix documentation/comments for Model.findById

1 parent 1c72bc93
Showing with 5 additions and 5 deletions
...@@ -1440,19 +1440,19 @@ Model.$findSeparate = function(results, options) { ...@@ -1440,19 +1440,19 @@ Model.$findSeparate = function(results, options) {
}; };
/** /**
* Search for a single instance by its primary key. This applies LIMIT 1, so the listener will always be called with a single instance. * Search for a single instance by its primary key.
* *
* @param {Number|String|Buffer} [options] A hash of options to describe the scope of the search, or a number to search by id. * @param {Number|String|Buffer} id The value of the desired instance's primary key.
* @param {Object} ' [options] * @param {Object} [options]
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* *
* @see {Model#findAll} for an explanation of options * @see {Model#findAll} for a full explanation of options
* @return {Promise<Instance>} * @return {Promise<Instance>}
* @alias findByPrimary * @alias findByPrimary
*/ */
Model.prototype.findById = function(param, options) { Model.prototype.findById = function(param, options) {
// For sanity findById will never return if no options are passed // return Promise resolved with null if no arguments are passed
if ([null, undefined].indexOf(param) !== -1) { if ([null, undefined].indexOf(param) !== -1) {
return Promise.resolve(null); return Promise.resolve(null);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!