From 91ae176bc38ba2eaefad55ddaae8cb80de196b13 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 8 Jun 2010 11:24:06 +0100 Subject: Moving token generation to commonlib/rblib/util.rb --- app/models/post_redirect.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app/models') diff --git a/app/models/post_redirect.rb b/app/models/post_redirect.rb index edd151730..655b3ac58 100644 --- a/app/models/post_redirect.rb +++ b/app/models/post_redirect.rb @@ -61,11 +61,7 @@ class PostRedirect < ActiveRecord::Base # Makes a random token, suitable for using in URLs e.g confirmation messages. def self.generate_random_token - bits = 12 * 8 - # Make range from value to double value, so number of digits in base 36 - # encoding is quite long always. - rand_num = rand(max = 2**(bits+1)) + 2**bits - rand_num.to_s(base=36) + MySociety::Util.generate_token end # Make the token -- cgit v1.2.3