X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/04f827dd4647f3a7d6e5bd8f5e9083c730a8dccc..ac5e3489e8b886b7b8a7252ab56ddeb3d3bdadc7:/app/controllers/quickvote_controller.rb diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index c3510f6..9ae1748 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -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 = []