delving/culture-hub — pull request #419 by manuelbernhardt (2012-01-18 14:09:48+00:00)
Title: Simple moderation

Simple moderation. This needs to be ran as evolution on the databases:

var adjustEmbedded = function(it) {
if(typeof it.links !== "undefined") {
for(var i = 0; i < it.links.length; i++) {
it.links[i].blocked = false;
};
}
}

use culturecloud
db.Users.find().forEach(function(it) {
it.blocked = false;
db.Users.save(it);
})

use culturehub

db.UserObjects.find().forEach(function(it) {
it.blocked = false;
adjustEmbedded(it);
db.UserObjects.save(it);
})
db.UserCollections.find().forEach(function(it) {
it.blocked = false;
adjustEmbedded(it);
db.UserCollections.save(it);
})
db.UserStories.find().forEach(function(it) {
it.blocked = false;
adjustEmbedded(it);
db.UserStories.save(it);
})
db.Links.find().forEach(function(it) {
it.blocked = false;
db.Links.save(it);
})