Created
January 11, 2013 23:08
-
-
Save crtr0/4514733 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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