Major changes in this commit over include work over several days but that was never...
[selectricity-live] / app / models / voter.rb
1 class Voter < ActiveRecord::Base
2   belongs_to :election
3   has_one :vote
4
5   def initialize(args)
6     super(args)
7     
8     token_generator = UniqueTokenGenerator.new( 16 )
9     until password and Voter.find_all( [ "password = ?", password ]).empty?
10       self.password = token_generator.token
11     end
12   end
13
14 end
15
16
17

Benjamin Mako Hill || Want to submit a patch?