diff --git a/Jakefile.js b/Jakefile.js index d607012..cdb440f 100755 --- a/Jakefile.js +++ b/Jakefile.js @@ -102,7 +102,12 @@ namespace('db', function() { var Client; log('- db:populate'.yellow); - + if (!JK.models) { + JK.models = {}; + ['client'].forEach(function (elem, index) { + JK.models[elem] = require('./app/models/' + elem)(JK.mongoose); + }); + } Client = JK.models.client; howMany = howMany || 50; diff --git a/app/models/client.js b/app/models/client.js index 4b90a36..e2b3885 100755 --- a/app/models/client.js +++ b/app/models/client.js @@ -1,5 +1,6 @@ module.exports = function(mongoose) { var validator = require('../../lib/validator'), + mongoose = require('mongoose'), Schema = mongoose.Schema, Client;