Skip to content

Commit

Permalink
remove hardcoded username reference, use _id instead
Browse files Browse the repository at this point in the history
  • Loading branch information
luccastera committed Oct 26, 2012
1 parent 20bbe64 commit 53f5841
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/nested_set.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down Expand Up @@ -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);
}
});
Expand All @@ -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);
}
});
Expand Down

0 comments on commit 53f5841

Please sign in to comment.