]> projects.mako.cc - selectricity-live/blobdiff - app/models/token.rb
licensed under the AGPL
[selectricity-live] / app / models / token.rb
old mode 100755 (executable)
new mode 100644 (file)
index 2bab513..e9f4fd6
@@ -1,11 +1,11 @@
-class Token < ActiveRecord::Base
-  belongs_to :vote 
-
+class Token < ActiveRecord::Base 
+  belongs_to :vote
+  
   def initialize
     super
 
     token_generator = UniqueTokenGenerator.new( 16 )
   def initialize
     super
 
     token_generator = UniqueTokenGenerator.new( 16 )
-    until not token.empty? and Token.find_all( [ "token = ?", token ]).empty?
+    until not token.empty? and Token.find(:all, :conditions => [ "token = ?", token ]).empty?
       self.token = token_generator.token
     end
 
       self.token = token_generator.token
     end
 

Benjamin Mako Hill || Want to submit a patch?