Permalink
Browse files

Merge branch 'master' of github1602:1602/jugglingdb

  • Loading branch information...
2 parents 0419057 + 9a7d3f1 commit aaf6987a9388a3b8c4aed7f388ca72a34eec7dcd @1602 committed Apr 22, 2013
Showing with 4 additions and 5 deletions.
  1. +3 −4 lib/model.js
  2. +1 −1 lib/schema.js
View
7 lib/model.js
@@ -260,13 +260,12 @@ AbstractClass.create = function (data, callback) {
function stillConnecting(schema, obj, args) {
if (schema.connected) return false;
- if (!schema.connecting) {
- schema.connect();
- }
+ if (schema.connecting) return true;
var method = args.callee;
- schema.on('connected', function () {
+ schema.once('connected', function () {
method.apply(obj, [].slice.call(args));
});
+ schema.connect();
return true;
};
View
2 lib/schema.js
@@ -67,7 +67,7 @@ function Schema(name, settings) {
// Disconnected by default
this.connected = false;
- this.connecting = true;
+ this.connecting = false;
// create blank models pool
this.models = {};

0 comments on commit aaf6987

Please sign in to comment.