I'm using Merit gem to add reputation system to my application for users that are logged in.
This is an example of how I'm using score
to handle voting:
def initialize
score 5, on: 'posts#upvote', to: :user
score -5, on: 'posts#downvote', to: :user
score 1, on: 'posts#upvote', to: :itself
score -1, on: 'posts#downvote', to: :itself
end
The problem is that with this solution, users can vote on the posts as many times as they want. I would like users to only have a single vote per post. Is there any way to prevent users from voting multiple times?