Skip to content

Instantly share code, notes, and snippets.

@crtr0
Created January 11, 2013 23:08
Show Gist options
  • Select an option

  • Save crtr0/4514733 to your computer and use it in GitHub Desktop.

Select an option

Save crtr0/4514733 to your computer and use it in GitHub Desktop.
saveVote = exports.saveVote = function(event, vote, from) {
// The _id of our vote document will be a composite of our event_id and the
// person's phone number. This will guarantee one vote per event
var voteDoc = {
_id: 'vote:' + event._id + ':' + from,
type: 'vote',
event_id: event._id,
event_phonenumber: event.phonenumber,
vote: vote,
phonenumber: from
};
votesCache.push(voteDoc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment