X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/af840c52358dc9fa8378194b2c05872dcd50dd69..e3b1d64e4220f627e53b6c8c0f70ba941dfdc788:/app/models/vote.rb diff --git a/app/models/vote.rb b/app/models/vote.rb index 21b5408..98b5704 100644 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -87,7 +87,7 @@ class Vote < ActiveRecord::Base # too. It creates a vote with the candidates listed in order of preference # based on alphabetical order. Meant to be manipulated and then confirmed def set_defaults! - self.votes = voter.election.candidates.sort.collect {|c| c.id } + self.votes = self.voter.election.candidates.sort_by { rand }.collect {|c| c.id } self.save end