Permalink
Browse files

changes to support mongoose 3.0

  • Loading branch information...
briankircho committed Aug 10, 2012
1 parent 135a83f commit c2de9387d454588a104456a7c5c8f7318a09fa24
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/tree.js
  2. +1 −1 package.json
  3. +2 −2 test/tree.js
View
@@ -22,7 +22,7 @@ function tree(schema, options) {
});
schema.pre('save', function(next) {
- var isParentChange = this.modifiedPaths.indexOf('parent') !== -1;
+ var isParentChange = this.isModified('parent');
if(this.isNew || isParentChange) {
if(!this.parent) {
View
@@ -11,7 +11,7 @@
"version": "0.0.1",
"engine": "node >= 0.4.0",
"dependencies": {
- "mongoose": "~2.7.1"
+ "mongoose": "~3.0.0"
},
"devDependencies": {
"async": "~0.1.22",
View
@@ -64,7 +64,7 @@ describe('tree tests', function() {
emily.remove(function(err) {
should.not.exist(err);
- User.find({}, ['name'], function(err, users) {
+ User.find(['name'], function(err, users) {
should.not.exist(err);
users.length.should.equal(4);
_.pluck(users, 'name').should.not.include('Emily');
@@ -80,7 +80,7 @@ describe('tree tests', function() {
user.remove(function(err) {
should.not.exist(err);
- User.find({}, ['name'], function(err, users) {
+ User.find(['name'], function(err, users) {
should.not.exist(err);
users.length.should.equal(2);

0 comments on commit c2de938

Please sign in to comment.