Created
August 28, 2014 02:44
-
-
Save antidiestro/d6b3fc00cc1b856a20df to your computer and use it in GitHub Desktop.
This file contains 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
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