X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/8dc61228b74613a5e585ef0a8cf7b4352e208717..277d9e323c1c9c525c1cea4590dc71bc56aeed06:/app/controllers/quickvote_controller.rb diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index c897f36..e7a285b 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -66,7 +66,7 @@ class QuickvoteController < ApplicationController @voter = nil end - # if the voter does not exist or as has been destroyed, lets + # if the voter does not exist or has has been destroyed, lets # create a new one unless @voter # create a new voter and populate it @@ -105,11 +105,16 @@ class QuickvoteController < ApplicationController else # record the ip address for posterity - @voter.ipaddress = request.env["REMOTE_ADDR"] + @voter.ipaddress = request.env["BLAH"] @voter.save - # toggle the confirmation bit + # save the time the vote was made for statistical use, it doesn't + #work here unless I use a method that will save it to the db + @voter.vote.time = Time.now + + # toggle the confirmation bit @voter.vote.confirm! + @voter.reload render :action => 'thanks' end @@ -158,10 +163,12 @@ class QuickvoteController < ApplicationController @plurality_result = PluralityVote.new(plurality_tally).result @approval_result = ApprovalVote.new(approval_tally).result - @condorcet_result = CloneproofSSDVote.new(preference_tally).result - @ssd_result = PureCondorcetVote.new(preference_tally).result + @condorcet_result = PureCondorcetVote.new(preference_tally).result + @ssd_result = CloneproofSSDVote.new(preference_tally).result @borda_result = BordaVote.new(preference_tally).result - @runoff_result = InstantRunoffVote.new(preference_tally).result + #@runoff_result = InstantRunoffVote.new(preference_tally).result + #@runoff_results = PluralityVote.new(preference_tally).result + @candidates = {} @election.candidates.each {|c| @candidates[c.id] = c}