]> projects.mako.cc - selectricity-live/blob - app/models/token.rb
added page for hc-anywhere
[selectricity-live] / app / models / token.rb
1 class Token < ActiveRecord::Base
2   belongs_to :vote 
3
4   def initialize
5     super
6
7     token_generator = UniqueTokenGenerator.new( 16 )
8     until not token.empty? and Token.find_all( [ "token = ?", token ]).empty?
9       self.token = token_generator.token
10     end
11
12     self
13   end
14
15   def to_s
16     self.token
17   end
18 end

Benjamin Mako Hill || Want to submit a patch?