Skip to content
Browse files

Change loadTypes for mongoose 3

  • Loading branch information...
1 parent d0025dd commit 3db6cb2952df72225667a1cc0e623ce56e5f1527 @Almad Almad committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/types/dbref.js
View
8 lib/types/dbref.js
@@ -51,7 +51,7 @@ var isArray = Array.isArray || function(obj) {
exports.loadType = function (mongoose) {
// The types that are used for schema and models
var SchemaType = mongoose.SchemaType;
- var SchemaTypes = mongoose.SchemaTypes;
+ var SchemaTypes = mongoose.Schema.Types;
var CastError = SchemaType.CastError;
// The native type used for storage
@@ -63,7 +63,7 @@ exports.loadType = function (mongoose) {
};
// Direct inheritence from schema type
- DBRef.prototype.__proto__ = SchemaType.prototype;
+ DBRef.prototype.__proto__ = mongoose.SchemaType.prototype;
// Testing method to evaluate whether check needed
DBRef.prototype.checkRequired = function (value) {
@@ -121,8 +121,8 @@ exports.loadType = function (mongoose) {
};
// Perform the installation
- mongoose.SchemaTypes.DBRef = DBRef;
- mongoose.Types.DBRef = dbref;
+ mongoose.SchemaType.DBRef = DBRef;
+ mongoose.Schema.Types.DBRef = DBRef;
// Return the type
return DBRef;

0 comments on commit 3db6cb2

Please sign in to comment.
Something went wrong with that request. Please try again.