Skip to content

Commit

Permalink
Fix a mistake.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrded committed Sep 29, 2017
1 parent 7104040 commit 43bd7fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -101,11 +101,12 @@ module.exports = function (sails) {
// 0.12: sails.config.models.connection
// 1.00: sails.config.models.datastore
var defaultConnection = sails.config.models.connection || sails.config.models.datastore || 'default';

for (modelName in models) {
modelDef = models[modelName];
sails.log.verbose('Loading model \'' + modelDef.globalId + '\'');

connectionName = modelDef.options.connection || defaultConnection;
connectionName = modelDef.options.connection || modelDef.datastore || defaultConnection;

modelClass = connections[connectionName].define(modelDef.globalId, modelDef.attributes, modelDef.options);

Expand Down

0 comments on commit 43bd7fd

Please sign in to comment.