]> projects.mako.cc - selectricity-live/blob - app/models/voter.rb
e9b3e9e2cfe4901a91df669815d6d8a0b944890f
[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?