wired up vote ux
This commit is contained in:
parent
74b2415b91
commit
e8e745f356
@ -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
|
||||
|
49
test/fixtures/reviewer_votes.yml
vendored
49
test/fixtures/reviewer_votes.yml
vendored
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user