wired up vote ux

This commit is contained in:
Mark Moser 2016-11-20 11:35:08 -06:00
parent 74b2415b91
commit e8e745f356
2 changed files with 24 additions and 28 deletions

View File

@ -50,8 +50,7 @@ class User < ApplicationRecord
def my_vote candidate def my_vote candidate
candidate = Candidate.find(candidate.to_i) candidate = Candidate.find(candidate.to_i)
my_votes = votes.find_by(candidate_id: candidate.id) votes.find_by(candidate_id: candidate.id).vote
my_votes.nil? ? "undecided" : my_votes.votes
end end
# Roles # Roles

View File

@ -1,4 +1,3 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
manager_richard: manager_richard:
candidate: richard candidate: richard
@ -17,23 +16,6 @@ reviewer2_richard:
manager_wade:
candidate: wade
user: manager
vote: 2
veto: 2
reviewer_wade:
candidate: wade
user: reviewer
vote: 2
# reviewer2_wade:
# candidate: wade
# user: reviewer2
manager_stacy: manager_stacy:
candidate: stacy candidate: stacy
user: manager user: manager
@ -50,18 +32,33 @@ reviewer2_stacy:
vote: 2 vote: 2
manager_henry: manager_henry:
candidate: henry candidate: henry
user: manager user: manager
vote: 0 vote: 0
veto: 2 veto: 2
# reviewer_henry: reviewer_henry:
# candidate: henry candidate: henry
# user: reviewer user: reviewer
#
# reviewer2_henry: reviewer2_henry:
# candidate: henry candidate: henry
# user: reviewer2 user: reviewer2
manager_wade:
candidate: wade
user: manager
vote: 2
veto: 2
reviewer_wade:
candidate: wade
user: reviewer
vote: 2
reviewer2_wade:
candidate: wade
user: reviewer2