wired up vote ux
This commit is contained in:
@ -50,8 +50,7 @@ class User < ApplicationRecord
|
||||
def my_vote candidate
|
||||
candidate = Candidate.find(candidate.to_i)
|
||||
|
||||
my_votes = votes.find_by(candidate_id: candidate.id)
|
||||
my_votes.nil? ? "undecided" : my_votes.votes
|
||||
votes.find_by(candidate_id: candidate.id).vote
|
||||
end
|
||||
|
||||
# Roles
|
||||
|
Reference in New Issue
Block a user