Skip to content

Commit

Permalink
test: fix test re: #9406
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 7, 2020
1 parent ad1d18a commit abb2e74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ Mongoose.prototype.model = function(name, schema, collection, skipInit) {

// connection.model() may be passing a different schema for
// an existing model name. in this case don't read from cache.
const overwriteModels = this.options.hasOwnProperty('overwriteModels') ?
this.options.overwriteModels :
const overwriteModels = _mongoose.options.hasOwnProperty('overwriteModels') ?
_mongoose.options.overwriteModels :
options.overwriteModels;
if (_mongoose.models[name] && options.cache !== false && overwriteModels !== true) {
if (originalSchema &&
Expand Down

0 comments on commit abb2e74

Please sign in to comment.