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
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

View File

@ -1,4 +1,3 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
manager_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:
candidate: stacy
user: manager
@ -50,18 +32,33 @@ reviewer2_stacy:
vote: 2
manager_henry:
candidate: henry
user: manager
vote: 0
veto: 2
# reviewer_henry:
# candidate: henry
# user: reviewer
#
# reviewer2_henry:
# candidate: henry
# user: reviewer2
reviewer_henry:
candidate: henry
user: reviewer
reviewer2_henry:
candidate: henry
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