]> projects.mako.cc - selectricity-live/blobdiff - app/controllers/quickvote_controller.rb
The user model has been modified so that it stores the user object itself in the...
[selectricity-live] / app / controllers / quickvote_controller.rb
index 10815b3c590ac19af542240d3cf8ec6d420cb9e9..5482a25c99f3d46d12149a4c84ab02725c622f1b 100644 (file)
@@ -105,11 +105,16 @@ class QuickvoteController < ApplicationController
       
     else
       # record the ip address for posterity
-      @voter.ipaddress = request.env["HTTP_X_FORWARDED_FOR"]
+      @voter.ipaddress = request.env["REMOTE_ADDR"]
       @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

Benjamin Mako Hill || Want to submit a patch?