From d411c85a65baaf4ed268b1b1bb4df408cee4981a Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Mon, 23 May 2011 12:02:06 +0100 Subject: Replace references to ActiveSupport::SecureRandom with just SecureRandom, and require 'securerandom' from the stdlib when active support is required. --- railties/lib/rails/generators/rails/app/app_generator.rb | 2 +- railties/lib/rails/tasks/misc.rake | 2 +- railties/test/application/middleware/cache_test.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 5f9fb9685c..242677cc65 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -272,7 +272,7 @@ module Rails end def app_secret - ActiveSupport::SecureRandom.hex(64) + SecureRandom.hex(64) end def mysql_socket diff --git a/railties/lib/rails/tasks/misc.rake b/railties/lib/rails/tasks/misc.rake index e505b8c338..53e479b924 100644 --- a/railties/lib/rails/tasks/misc.rake +++ b/railties/lib/rails/tasks/misc.rake @@ -10,7 +10,7 @@ end desc 'Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions).' task :secret do require 'active_support/secure_random' - puts ActiveSupport::SecureRandom.hex(64) + puts SecureRandom.hex(64) end desc 'List versions of all Rails frameworks and the environment' diff --git a/railties/test/application/middleware/cache_test.rb b/railties/test/application/middleware/cache_test.rb index f582ed0e42..a8033d2b23 100644 --- a/railties/test/application/middleware/cache_test.rb +++ b/railties/test/application/middleware/cache_test.rb @@ -16,7 +16,7 @@ module ApplicationTests class ExpiresController < ApplicationController def expires_header expires_in 10, :public => !params[:private] - render :text => ActiveSupport::SecureRandom.hex(16) + render :text => SecureRandom.hex(16) end def expires_etag @@ -30,7 +30,7 @@ module ApplicationTests private def render_conditionally(headers) if stale?(headers.merge(:public => !params[:private])) - render :text => ActiveSupport::SecureRandom.hex(16) + render :text => SecureRandom.hex(16) end end end -- cgit v1.2.3