Skip to content

Commit

Permalink
Added a fix for defineAuto
Browse files Browse the repository at this point in the history
  • Loading branch information
canuc committed Jan 26, 2015
1 parent 7bcb4cd commit 57c2306
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/persist.js
Expand Up @@ -55,21 +55,19 @@ exports.defineAuto = function(name, options, callback) {
default:
throw new TypeError('Error with options param, must be connection options or callback.');
}

}

this.asyncQueue().push(connectionOptions, function(err, result) {

if ( err ) {
callbackFcn(err);
return;
}

if (result.tables.hasOwnProperty(pluralName)) {
var columnDefs = result.tables[pluralName].columns;
for (var propertyName in columnDefs) {
columnDefs[propertyName].dbColumnName = propertyName;
}
var model = Model.define(name, columnDefs);
var model = Model.define(pluralName, columnDefs);
callbackFcn(null, model);
}
});
Expand Down

0 comments on commit 57c2306

Please sign in to comment.