X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/05ebed925ae2b5e7bf2a599536ba7d7ac15ffbf7..20cae2b9f1107273ddf18cd9d5f78d873ec9afd2:/app/models/token.rb 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