X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/98bb7b88caea42148d7ebd72e408f523bcac4f96..3130bc1c24f60ec0db68ef9a8e996ecae6eac385:/app/controllers/voter_controller.rb diff --git a/app/controllers/voter_controller.rb b/app/controllers/voter_controller.rb index 45b9a1a..d7f589d 100644 --- a/app/controllers/voter_controller.rb +++ b/app/controllers/voter_controller.rb @@ -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