Permalink
Browse files

Revert "Merge pull request #10961 from wangjohn/changing_rails_env_co…

…nfig"

This reverts commit 7098d6c, reversing
changes made to 9ec2e2e.
This make some tests fail /cc @wangjohn
  • Loading branch information...
spastorino committed Jun 18, 2013
1 parent a95ffad commit fa4cf9407c0a64d7c0a86da735b82aafb37f6866
Showing with 24 additions and 7 deletions.
  1. +24 −7 railties/lib/rails/application.rb
@@ -119,9 +119,32 @@ def key_generator
# Stores some of the Rails initial environment parameters which
# will be used by middlewares and engines to configure themselves.
+ # Currently stores:
+ #
+ # * "action_dispatch.parameter_filter" => config.filter_parameters
+ # * "action_dispatch.redirect_filter" => config.filter_redirect
+ # * "action_dispatch.secret_token" => config.secret_token
+ # * "action_dispatch.secret_key_base" => config.secret_key_base
+ # * "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
+ # * "action_dispatch.http_auth_salt" => config.action_dispatch.http_auth_salt
+ # * "action_dispatch.signed_cookie_salt" => config.action_dispatch.signed_cookie_salt
+ # * "action_dispatch.encrypted_cookie_salt" => config.action_dispatch.encrypted_cookie_salt
+ # * "action_dispatch.encrypted_signed_cookie_salt" => config.action_dispatch.encrypted_signed_cookie_salt
+ #
def env_config
@app_env_config ||= begin
- validate_secret_token_config!
+ if config.secret_key_base.blank?
+ ActiveSupport::Deprecation.warn "You didn't set config.secret_key_base. " +
+ "Read the upgrade documentation to learn more about this new config option."
+
+ if config.secret_token.blank?
+ raise "You must set config.secret_key_base in your app's config."
+ end
+ end
super.merge({
"action_dispatch.parameter_filter" => config.filter_parameters,
@@ -291,11 +314,5 @@ def build_original_fullpath(env) #:nodoc:
"#{script_name}#{path_info}"
end
end
-
- def validate_secret_token_config! #:nodoc:
- if config.secret_token.blank?
- raise "You must set config.secret_key_base in your app's config."
- end
- end
end
end

0 comments on commit fa4cf94

Please sign in to comment.