diff options
author | Francis Irving <francis@mysociety.org> | 2010-06-08 13:00:29 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-06-08 13:00:29 +0100 |
commit | c0b96622c20ec8632de38e31e6fb6a5b62cfa6f6 (patch) | |
tree | edadf0f7ac024e82e13ddaf0c011ffe8866b56d6 | |
parent | 942ce15a177392b42276d16dbe0c77805d975e8a (diff) | |
parent | 91ae176bc38ba2eaefad55ddaae8cb80de196b13 (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/whatdotheyknow
-rw-r--r-- | app/models/post_redirect.rb | 6 | ||||
m--------- | commonlib | 0 | ||||
-rw-r--r-- | config/environment.rb | 1 |
3 files changed, 2 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 diff --git a/commonlib b/commonlib -Subproject a901c2a431f7869f5c2eaee5808f8590ca78544 +Subproject 5baec579b8ede57d71e114a8721d2d4a2c667ef diff --git a/config/environment.rb b/config/environment.rb index 3ba4592a3..b0effaabd 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -24,6 +24,7 @@ load "validate.rb" load "config.rb" load "format.rb" load "debug_helpers.rb" +load "util.rb" Rails::Initializer.run do |config| # Load intial mySociety config |