Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set up the connected handler before connect

  • Loading branch information...
commit 3613f6e22f06509e93a49ec0f600d9d09eca05f4 1 parent 589908a
@raymondfeng authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/model.js
View
5 lib/model.js
@@ -258,13 +258,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 () {
method.apply(obj, [].slice.call(args));
});
+ schema.connect();
return true;
};
Please sign in to comment.
Something went wrong with that request. Please try again.