ActiveSupport::SecureRandom was deprecated in favor of SecureRandom from the standard lib

pull/1186/head
Martin Linkhorst 12 years ago committed by Martin Linkhorst
parent e5e2202707
commit 5a93169800
  1. 2
      app/models/mail_handler.rb
  2. 2
      app/models/token.rb
  3. 2
      app/models/user.rb
  4. 2
      lib/tasks/initializers.rake
  5. 2
      test/test_helper.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

@ -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)

@ -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

@ -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)

Loading…
Cancel
Save