wired up vote ux
This commit is contained in:
parent
74b2415b91
commit
e8e745f356
@ -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
|
||||||
|
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:
|
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user