]> projects.mako.cc - selectricity/blobdiff - app/models/vote.rb
Working on a step-by-step workflow audit.
[selectricity] / app / models / vote.rb
index 82f34a929bb6443a7d0b5058ff1263bbb1736ab3..429e212377781d27aa4a5580d9dcb65abd5b19eb 100644 (file)
@@ -36,7 +36,7 @@ class Vote < ActiveRecord::Base
     destroy_rankings
     self.votes.each_with_index do |candidate, index| 
       ranking = Ranking.new
     destroy_rankings
     self.votes.each_with_index do |candidate, index| 
       ranking = Ranking.new
-      ranking.rank = index + 1
+      ranking.rank = index
       ranking.candidate =  Candidate.find(candidate)
       self.rankings << ranking
     end
       ranking.candidate =  Candidate.find(candidate)
       self.rankings << ranking
     end

Benjamin Mako Hill || Want to submit a patch?