Permalink
Browse files

remove hardcoded username reference, use _id instead

  • Loading branch information...
luccastera committed Oct 26, 2012
1 parent 20bbe64 commit 53f58419191bbe6744aa04f92b7899a5d98730a4
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/nested_set.js
View
@@ -173,7 +173,7 @@ var NestedSetPlugin = function(schema, options) {
if (err) {
callback(err, null);
} else {
- var nodesMinusSelf = nodes.filter(function(node) { return self.username != node.username; });
+ var nodesMinusSelf = nodes.filter(function(node) { return self._id.toString() !== node._id.toString(); });
callback(null, nodesMinusSelf);
}
});
@@ -210,7 +210,7 @@ var NestedSetPlugin = function(schema, options) {
if (err) {
callback(err, null);
} else {
- var nodesMinusSelf = nodes.filter(function(node) { return self.username != node.username; });
+ var nodesMinusSelf = nodes.filter(function(node) { return self._id.toString() !== node._id.toString(); });
callback(null, nodesMinusSelf);
}
});
@@ -229,7 +229,7 @@ var NestedSetPlugin = function(schema, options) {
if (err) {
callback(err, null);
} else {
- var nodesMinusSelf = nodes.filter(function(node) { return self.username != node.username; });
+ var nodesMinusSelf = nodes.filter(function(node) { return self._id.toString() !== node._id.toString(); });
callback(null, nodesMinusSelf);
}
});

0 comments on commit 53f5841

Please sign in to comment.