@@ -36,9 +36,6 class Token < ActiveRecord::Base | |||
|
36 | 36 | |
|
37 | 37 | private |
|
38 | 38 | def self.generate_token_value |
|
39 | chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a | |
|
40 | token_value = '' | |
|
41 | 40.times { |i| token_value << chars[rand(chars.size-1)] } | |
|
42 | token_value | |
|
39 | ActiveSupport::SecureRandom.hex(20) | |
|
43 | 40 | end |
|
44 | 41 | end |
General Comments 0
You need to be logged in to leave comments.
Login now