diff options
author | Louise Crow <louise.crow@gmail.com> | 2010-06-08 11:24:06 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2010-06-08 11:24:06 +0100 |
commit | 91ae176bc38ba2eaefad55ddaae8cb80de196b13 (patch) | |
tree | 72974043d1d85164706ce1ea58735e0267c76712 /app/models | |
parent | 26a70c03538d8c12edfca4e3dd9b9fd0ef4b5f19 (diff) |
Moving token generation to commonlib/rblib/util.rb
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/post_redirect.rb | 6 |
1 files changed, 1 insertions, 5 deletions
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 |