Ejemplo n.º 1
0
 models.forEach(function (model) {
   tasks.push(app.series.bind(app, 'model:load', model));
   model._relatedColumns.forEach(function (col) {
     if (typeof model[col] != 'undefined') {
       tasks.push(app.series.bind(app, 'model:load', model[col]));
     }
   });
 });
Ejemplo n.º 2
0
 stream.on('result', function (row) {
   var model = ModelClass.createFromQuery(row);
   var tasks = [];
   tasks.push(app.series.bind(app, 'model:load', model));
   model._relatedColumns.forEach(function (col) {
     if (typeof model[col] != 'undefined') {
       tasks.push(app.series.bind(app, 'model:load', model[col]));
     }
   });
   app.utils.async.parallel(tasks, function (err) {
     if (err) return app.emit('error', err);
     stream.emit('model', model);
   });
 });