Small fixes for effects, health, permissions and formatting

This commit is contained in:
Thaum
2015-04-07 13:32:35 +00:00
parent 2fac76f702
commit 974c4fe706
8 changed files with 118 additions and 103 deletions

View File

@@ -130,7 +130,7 @@ var checkPermission = function(userId, charId){
var cascadeSoftRemove = function(id, removedWithId){
_.each(childCollections, function(treeCollection){
treeCollection.update({"parent.id": id}, {$set: {removed: true, removedWith: removedWithId}});
treeCollection.update({"parent.id": id}, {$set: {removed: true, removedWith: removedWithId}}, {multi: true});
treeCollection.find({"parent.id": id}).forEach(function(doc){
cascadeSoftRemove(doc._id, removedWithId);
});
@@ -158,7 +158,7 @@ Meteor.methods({
var collection = Mongo.Collection.get(collectionName);
collection.restore(id);
_.each(childCollections, function(treeCollection){
treeCollection.update({removedWith: id, removed: true}, { $unset: {removed: true, removedWith: ""} });
treeCollection.update({removedWith: id, removed: true}, { $unset: {removed: true, removedWith: ""} }, {multi: true});
});
},
updateChildren: function (parent, modifier, limitToInheritance) {