]> projects.mako.cc - selectricity-live/blobdiff - app/controllers/quickvote_controller.rb
Made a large number of mostly cosmetic fixes after a detailed
[selectricity-live] / app / controllers / quickvote_controller.rb
index c3510f60bfb34a8b9775f04afe1ef310ac2b8263..9ae174800bc2ae2506bc0a5bbb6871a725732832 100644 (file)
@@ -11,7 +11,7 @@ class QuickvoteController < ApplicationController
                                   session.session_id, @election.id])[0]
     unless @voter 
       @voter = QuickVoter.new
-      @voter.election = Election.find_all( [ "name = ?", params[:votename] ] )[0]
+      @voter.election = QuickVote.find_all( [ "name = ?", params[:votename] ] )[0]
     end
   end
 
@@ -42,6 +42,7 @@ class QuickvoteController < ApplicationController
       @voter = QuickVoter.new()
       @voter.election = election
       @voter.session_id = session.session_id
+      @voter.ipaddress = request.env["REMOTE_ADDR"]
       @voter.save
       @voter.reload
         
@@ -53,7 +54,7 @@ class QuickvoteController < ApplicationController
   end
   
   def results
-    @election = Election.find_all( ["name = ?", params[:votename]] )[0]
+    @election = QuickVote.find_all( ["name = ?", params[:votename]] )[0]
 
     preference_tally = []
     plurality_tally = []

Benjamin Mako Hill || Want to submit a patch?