I have added the acts_as_authenticated plugin to code, and have gotten VERY BASIC...
[selectricity] / app / controllers / quickvote_controller.rb
index c897f369f33018bd9c3b5ffec552e20bdc0585ce..10815b3c590ac19af542240d3cf8ec6d420cb9e9 100644 (file)
@@ -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,7 +105,7 @@ class QuickvoteController < ApplicationController
       
     else
       # record the ip address for posterity
-      @voter.ipaddress = request.env["REMOTE_ADDR"]
+      @voter.ipaddress = request.env["HTTP_X_FORWARDED_FOR"]
       @voter.save
       
       # toggle the confirmation bit
@@ -158,10 +158,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}

Benjamin Mako Hill || Want to submit a patch?