From 653aab856ce2491e166a8b79c1e4eec2abce5edb Mon Sep 17 00:00:00 2001 From: Rand McKinney Date: Thu, 29 May 2014 15:33:01 -0700 Subject: [PATCH] JSDoc improvements Improve createModel doc, Fix some other minor issues. --- lib/datasource.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/datasource.js b/lib/datasource.js index e20d481e..44f9957e 100644 --- a/lib/datasource.js +++ b/lib/datasource.js @@ -494,7 +494,11 @@ DataSource.prototype.setupDataAccess = function (modelClass, settings) { }; /** - * Define a model class. + * Define a model class. Returns newly created model object. + * The first (String) argument specifying the model name is required. + * You can provide one or two JSON object arguments, to provide configuration options. + * See [Model definition reference](http://docs.strongloop.com/display/DOC/Model+definition+reference) for details. + * * Simple example: * ``` * var User = dataSource.createModel('User', { @@ -533,9 +537,8 @@ DataSource.prototype.setupDataAccess = function (modelClass, settings) { * ``` * * @param {String} className Name of the model to create. - * @param {Object} properties Hash of class properties in format `{property: Type, property2: Type2, ...}` or `{property: {type: Type}, property2: {type: Type2}, ...}` - * @param {Object} settings Other configuration settings. - * @returns newly created class + * @param {Object} properties Hash of model properties in format `{property: Type, property2: Type2, ...}` or `{property: {type: Type}, property2: {type: Type2}, ...}` + * @options {Object} properties Other configuration options. This corresponds to the options key in the config object. * */ @@ -766,10 +769,10 @@ DataSource.prototype.autoupdate = function (models, cb) { * * Keys in options object: * - * @property all {Boolean} If true, discover all models; if false, discover only models owned by the current user. - * @property views {Boolean} If true, nclude views; if false, only tables. - * @property limit {Number} Page size - * @property offset {Number} Starting index + * @property {Boolean} all If true, discover all models; if false, discover only models owned by the current user. + * @property {Boolean} views If true, nclude views; if false, only tables. + * @property {Number} limit Page size + * @property {Number} offset Starting index * */ DataSource.prototype.discoverModelDefinitions = function (options, cb) {