Skip to content

Commit

Permalink
fix(Mongoose): fix connection setter
Browse files Browse the repository at this point in the history
  • Loading branch information
jinasonlin committed Dec 5, 2017
1 parent d90100e commit 4a1e474
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,10 @@ Mongoose.prototype.__defineGetter__('connection', function() {
});

Mongoose.prototype.__defineSetter__('connection', function(v) {
this.connections[0] = v;
if (v instanceof Connection) {
this.connections[0] = v;
this.models = v.models;
}
});

/*!
Expand Down

0 comments on commit 4a1e474

Please sign in to comment.