Modified the methods in graphs controller so they would work for Selectricity, but...
[selectricity] / app / models / election.rb
index 0907e68a4cfc7e5796ef9920bbfca09a4b0cd0bd..ebd623a6b186d4006d54c2f144557d0003a169fa 100755 (executable)
@@ -10,7 +10,7 @@ class Election < ActiveRecord::Base
   def startdate
     read_attribute( :startdate ) || Time.now
   end
-
+  
   def enddate
     date = read_attribute( :enddate ) || Time.now + 14
     date - 1.second
@@ -22,6 +22,14 @@ class Election < ActiveRecord::Base
     super(date)
   end
 
+  def votes
+    votes = Array.new
+    self.voters.each do |voter|
+      votes << voter.vote
+    end
+    return votes
+  end
+
   def destroy
     self.candidates.each do |candidate|
       candidate.destroy

Benjamin Mako Hill || Want to submit a patch?