Merge from head
[selectricity-live] / app / models / token.rb
index 2bab51314f0df581cd22684811fe0360d8025918..e9f4fd637b94e2e91f533e4a0c1925e803c883d4 100644 (file)
@@ -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 )
-    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
 

Benjamin Mako Hill || Want to submit a patch?