]> projects.mako.cc - selectricity-live/blobdiff - app/controllers/elections_controller.rb
Fixed the detailed results so that they return anonymized results in
[selectricity-live] / app / controllers / elections_controller.rb
index 696028e1287baabe6f3431ea12c337bcee0e4238..4a85c293b5ea4b424cf78c852e39ca45496feaec 100644 (file)
@@ -100,7 +100,30 @@ class ElectionsController < ApplicationController
     voter.destroy
   end
   
+  def summary_results 
+  end
+  
+  def detailed_results
+    @election = Election.find( params[:id] )
+
+    @voter_list = []
+    @vote_list = []
+    @election.voters.each do |voter|
+      if voter.vote and voter.vote.confirmed?
+        @voter_list << voter.email
+       @vote_list << voter.vote
+      end
+    end
+
+    @vote_list.sort!
+    @vote_list.sort! { |a,b| a.token <=> b.token }
+    #breakpoint
+
+  end
+  
   private
+    def randomize_order
+    end
 
     def process_incoming_voters(raw_voter_list)
       incoming_voters = RawVoterList.new( raw_voter_list )
@@ -127,4 +150,8 @@ class ElectionsController < ApplicationController
       @raw_voter_list = RawVoterList.new
       @raw_voter_list.email = incoming_voters.email
     end
+
+    def email_voter
+    end
+
 end

Benjamin Mako Hill || Want to submit a patch?