Skip to content

Instantly share code, notes, and snippets.

@mlhamel
Created June 4, 2012 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlhamel/2869742 to your computer and use it in GitHub Desktop.
Save mlhamel/2869742 to your computer and use it in GitHub Desktop.
req.family.admins.forEach(function(admin) {
req.family.admins.remove(admin);
});
req.family.members.filter(function(member) {
return member.parent;
}).forEach(function(member) {
req.family.addAdmin(member);
});
req.family.save(function(err) {
if(err) {
return next(new exception.Fatal(err));
} else {
return next(req.family);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment