corrected indentation issues
This commit is contained in:
parent
fe8ed86301
commit
5aa0efd818
|
@ -710,22 +710,22 @@ AbstractClass.hasMany = function hasMany(anotherClass, params) {
|
||||||
* @param {Class} anotherClass - class to belong
|
* @param {Class} anotherClass - class to belong
|
||||||
* @param {Object} params - configuration {as: 'propertyName', foreignKey: 'keyName'}
|
* @param {Object} params - configuration {as: 'propertyName', foreignKey: 'keyName'}
|
||||||
*
|
*
|
||||||
* {Usage examples}
|
* {Usage examples}
|
||||||
* Suppose model Post have a {belongsTo} relationship with User (the author of the post). You could declare it this way:
|
* Suppose model Post have a {belongsTo} relationship with User (the author of the post). You could declare it this way:
|
||||||
* Post.belongsTo(User, {as: 'author', foreignKey: 'userId'});
|
* Post.belongsTo(User, {as: 'author', foreignKey: 'userId'});
|
||||||
*
|
*
|
||||||
* When a post is loaded, you can load the related author with:
|
* When a post is loaded, you can load the related author with:
|
||||||
* post.author(function(err, user) {
|
* post.author(function(err, user) {
|
||||||
* // the user variable is your user object
|
* // the user variable is your user object
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* The related object is cached, so if later you try to get again the author, no additional request will be made.
|
* The related object is cached, so if later you try to get again the author, no additional request will be made.
|
||||||
* But there is an optional boolean parameter in first position that set whether or not you want to reload the cache:
|
* But there is an optional boolean parameter in first position that set whether or not you want to reload the cache:
|
||||||
* post.author(true, function(err, user) {
|
* post.author(true, function(err, user) {
|
||||||
* // The user is reloaded, even if it was already cached.
|
* // The user is reloaded, even if it was already cached.
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* This optional parameter default value is false, so the related object will be loaded from cache if available.
|
* This optional parameter default value is false, so the related object will be loaded from cache if available.
|
||||||
*/
|
*/
|
||||||
AbstractClass.belongsTo = function (anotherClass, params) {
|
AbstractClass.belongsTo = function (anotherClass, params) {
|
||||||
var methodName = params.as;
|
var methodName = params.as;
|
||||||
|
|
Loading…
Reference in New Issue