From 98bb7b88caea42148d7ebd72e408f523bcac4f96 Mon Sep 17 00:00:00 2001 From: Date: Sat, 27 Dec 2008 08:30:22 -0500 Subject: [PATCH 1/1] fix bug with token generator --- app/models/token.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/token.rb b/app/models/token.rb index c2d3667..8bfecc4 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -23,7 +23,8 @@ class Token < ActiveRecord::Base super token_generator = UniqueTokenGenerator.new( 16 ) - until not token.empty? and Token.find(:all, :conditions => [ "token = ?", token ]).empty? and token[0..3] != "open" + until token and not token.empty? \ + and Token.find(:all, :conditions => [ "token = ?", token ]).empty? and token[0..3] != "open" self.token = token_generator.token end -- 2.39.5