@ -337,7 +337,7 @@ class MailHandler < ActionMailer::Base
user.lastname = '-' if user.lastname.blank?
user.login = user.mail
user.password = ActiveSupport::SecureRandom.hex(5)
user.password = SecureRandom.hex(5)
user.language = Setting.default_language
user.save ? user : nil
end
@ -36,7 +36,7 @@ class Token < ActiveRecord::Base
private
def self.generate_token_value
ActiveSupport::SecureRandom.hex(20)
SecureRandom.hex(20)
# Removes obsolete tokens (same user and action)
@ -632,7 +632,7 @@ class User < Principal
# Returns a 128bits random salt as a hex string (32 chars long)
def self.generate_salt
ActiveSupport::SecureRandom.hex(16)
SecureRandom.hex(16)
def initialize_allowance_evaluators
@ -16,7 +16,7 @@ desc 'Generates a configuration file for cookie store sessions.'
file 'config/initializers/session_store.rb' do
path = Rails.root.join('config/initializers/session_store.rb').to_s
secret = ActiveSupport::SecureRandom.hex(40)
secret = SecureRandom.hex(40)
File.open(path, 'w') do |f|
f.write <<"EOF"
# This file was generated by 'rake config/initializers/session_store.rb',
@ -100,7 +100,7 @@ class ActiveSupport::TestCase
FileUtils.mkdir_p(Rails.root.join('tmp/pages'))
page_path = Rails.root.join("tmp/pages/#{ActiveSupport::SecureRandom.hex(16)}.html").to_s
page_path = Rails.root.join("tmp/pages/#{SecureRandom.hex(16)}.html").to_s
File.open(page_path, 'w') { |f| f.write(body) }
Launchy.open(page_path)