removes possibility of taking away support for proposals

This commit is contained in:
rgarcia
2015-09-14 13:11:47 +02:00
parent 220c611927
commit 6f7a6dcf3b
2 changed files with 3 additions and 20 deletions

View File

@@ -75,10 +75,7 @@ class Proposal < ActiveRecord::Base
end
def register_vote(user, vote_value)
return unless votable_by?(user)
if user.voted_for?(self)
unvote_by(user)
else
if votable_by?(user)
vote_by(voter: user, vote: vote_value)
end
end