X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/97978ceeb9047ec6894b822ca947a466c2462988..e7c2d2a211e0f5604acc53f4a941067d94d675a9:/app/models/user.rb?ds=sidebyside diff --git a/app/models/user.rb b/app/models/user.rb index 350ea2c3a..c0468f8b0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -32,11 +32,11 @@ class User < ActiveRecord::Base find_first([ "token = ? ", token]) end - def self.make_token + def self.make_token(length=30) chars = 'abcdefghijklmnopqrtuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' confirmstring = '' - 30.times do + length.times do confirmstring += chars[(rand * chars.length).to_i].chr end