diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index c4949e5739..6f412aa2d5 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -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 diff --git a/app/models/token.rb b/app/models/token.rb index cbd7245fa5..79f9abd465 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -36,7 +36,7 @@ class Token < ActiveRecord::Base private def self.generate_token_value - ActiveSupport::SecureRandom.hex(20) + SecureRandom.hex(20) end # Removes obsolete tokens (same user and action) diff --git a/app/models/user.rb b/app/models/user.rb index fe8f3b8c71..6fb8393c66 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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) end def initialize_allowance_evaluators diff --git a/lib/tasks/initializers.rake b/lib/tasks/initializers.rake index 63b712d03b..5a086693d3 100644 --- a/lib/tasks/initializers.rake +++ b/lib/tasks/initializers.rake @@ -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', diff --git a/test/test_helper.rb b/test/test_helper.rb index a9bbddfa32..2aecc75585 100644 --- a/test/test_helper.rb +++ b/test/test_helper.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)