aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-11-01 02:20:16 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2012-11-03 14:57:53 -0200
commite272000c80548c3de9380bb6c76397d018fb1c68 (patch)
tree51102475092afda1319201dea93366513f9d70f4 /railties/lib
parent60609bb50d5b99d78a01a945a539cccd061cd7e7 (diff)
downloadrails-e272000c80548c3de9380bb6c76397d018fb1c68.tar.gz
rails-e272000c80548c3de9380bb6c76397d018fb1c68.tar.bz2
rails-e272000c80548c3de9380bb6c76397d018fb1c68.zip
Warn config.derive_keys will be true by default in 4.1
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/application.rb26
1 files changed, 17 insertions, 9 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index f22025d35e..741b03d80e 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -130,15 +130,23 @@ module Rails
# These parameters will be used by middlewares and engines to configure themselves
#
def env_config
- @env_config ||= super.merge({
- "action_dispatch.parameter_filter" => config.filter_parameters,
- "action_dispatch.secret_token" => config.secret_token,
- "action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions,
- "action_dispatch.show_detailed_exceptions" => config.consider_all_requests_local,
- "action_dispatch.logger" => Rails.logger,
- "action_dispatch.backtrace_cleaner" => Rails.backtrace_cleaner,
- "action_dispatch.key_generator" => key_generator
- })
+ @env_config ||= begin
+ if config.secret_token_key.nil?
+ ActiveSupport::Deprecation.warn "You didn't set config.secret_token_key. " +
+ "This should be used instead of the old deprecated config.secret_token. " +
+ "Set config.secret_token_key instead of config.secret_token in config/initializers/secret_token.rb"
+ end
+
+ super.merge({
+ "action_dispatch.parameter_filter" => config.filter_parameters,
+ "action_dispatch.secret_token" => config.secret_token,
+ "action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions,
+ "action_dispatch.show_detailed_exceptions" => config.consider_all_requests_local,
+ "action_dispatch.logger" => Rails.logger,
+ "action_dispatch.backtrace_cleaner" => Rails.backtrace_cleaner,
+ "action_dispatch.key_generator" => key_generator
+ })
+ end
end
## Rails internal API