Add more comments

This commit is contained in:
Raymond Feng 2014-01-28 23:01:11 -08:00
parent 2a57a909f0
commit c008c4d30a
1 changed files with 5 additions and 1 deletions

View File

@ -544,9 +544,13 @@ DataAccessObject.find = function find(params, cb) {
if (params && params.include) {
if (params.collect) {
// Return the collected item for through models
// The collect property indicates that the query is to return the
// standlone items for a related model, not as child of the parent object
// For example, article.tags
obj = obj.__cachedRelations[params.collect];
} else {
// This handles the case to return parent items including the related
// models. For example, Article.find({include: 'tags'}, ...);
// Try to normalize the include
var includes = params.include || [];
if (typeof includes === 'string') {