#pref_tally = make_preference_tally(@election)
#@borda_result = BordaVote.new(pref_tally).result
+ @election.results unless @election.borda_result
data, labels = get_borda_points(@election.borda_result)
graph = GruffGraff.new( :graph_type => Gruff::Bar,
# Now I need to create an array with all the times votes were made
election.votes.each do |vote|
- voter_days << Date.parse(vote.time.to_s)
+ next unless vote.time
+ voter_days << Date.parse(vote.time.to_s)
end
voter_days.sort!
# Will build a graph over time, as each successive interval will have more
# vote objects
election.votes.each do |vote|
+ next unless vote.time
buckets.keys.sort.each do |inter|
if vote.time < inter
buckets[inter] << vote