projects
/
selectricity-live
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
2bab51314f0df581cd22684811fe0360d8025918
[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?