Skip to content

Instantly share code, notes, and snippets.

@antidiestro
Created August 28, 2014 02:44
Show Gist options
  • Save antidiestro/d6b3fc00cc1b856a20df to your computer and use it in GitHub Desktop.
Save antidiestro/d6b3fc00cc1b856a20df to your computer and use it in GitHub Desktop.
Skips.allow({
insert: function (userId, vote){
var voteCheck = Skips.findOne({user_id: userId, video_id: vote.video_id});
if ( voteCheck ) {
return false;
} else {
if ( userId && vote.user_id === userId ) {
return true;
} else {
return false;
}
}
},
remove: function(userId, vote){
if ( userId && vote.user_id === userId ) {
return true;
} else {
return false;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment