]> projects.mako.cc - selectricity-live/blobdiff - app/controllers/voter_controller.rb
create new open voter to allow open full elections
[selectricity-live] / app / controllers / voter_controller.rb
index 45b9a1a85f950cec5d54320942917be65071352c..d7f589db7f9d0b1d2e62d4806e11db686fd67ed3 100644 (file)
@@ -27,11 +27,11 @@ class VoterController < ApplicationController
     if params[:election_id]
       @election = Election.find(params[:election_id])
       unless @election.authenticated?
-        @voter = Voter.find(:all,
+        @voter = OpenVoter.find(:all,
           :conditions => ["session_id = ? and election_id = ?",
           session.session_id, @election.id])[0]
       
-        @voter = Voter.new unless @voter
+        @voter = OpenVoter.new unless @voter
 
         @voter.election = @election
         @voter.session_id = session.session_id
@@ -53,7 +53,7 @@ class VoterController < ApplicationController
         @voter.vote = Vote.new 
         @voter.save
       end
-      
+    
       @voter.vote.set_defaults! if @voter.vote.rankings.empty?
 
       # if the election is now finished 
@@ -194,7 +194,7 @@ class VoterController < ApplicationController
     if password == "open"
       election = Election.find(params[:format])
       unless election.authenticated?
-        @voter = Voter.find(:all,
+        @voter = OpenVoter.find(:all,
           :conditions => ["session_id = ? and election_id = ?",
                           session.session_id, election.id])[0]
         @password = "open." + election.id.to_s

Benjamin Mako Hill || Want to submit a patch?