lib: use strict, fix whitespaces

This commit is contained in:
Miroslav Bajtoš 2016-09-01 11:54:34 +02:00
parent 59090d8496
commit 3f3d32a556
2 changed files with 12 additions and 8 deletions

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
/*!
* Dependencies
*/
@ -39,25 +41,25 @@ function RelationMixin() {
*
* ```js
* Book.create(function(err, book) {
*
*
* // Create a chapter instance ready to be saved in the data source.
* var chapter = book.chapters.build({name: 'Chapter 1'});
*
*
* // Save the new chapter
* chapter.save();
*
*
* // you can also call the Chapter.create method with the `chapters` property
* // which will build a chapter instance and save the it in the data source.
* book.chapters.create({name: 'Chapter 2'}, function(err, savedChapter) {
* // this callback is optional
* });
*
* // Query chapters for the book
*
* // Query chapters for the book
* book.chapters(function(err, chapters) {
* // all chapters with bookId = book.id
* // all chapters with bookId = book.id
* console.log(chapters);
* });
*
*
* book.chapters({where: {name: 'test'}, function(err, chapters) {
* // All chapters with bookId = book.id and name = 'test'
* console.log(chapters);
@ -231,4 +233,4 @@ function defineRelationProperty(modelClass, def) {
return scope;
}
});
}
}

View File

@ -3,6 +3,8 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
/**
* Dependencies.
*/