1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Merge pull request #10961 from wangjohn/changing_rails_env_config"

This reverts commit 7098d6c9ab, reversing
changes made to 9ec2e2ee91.
This make some tests fail /cc @wangjohn
This commit is contained in:
Santiago Pastorino 2013-06-17 21:30:48 -04:00
parent a95ffadc14
commit fa4cf9407c

View file

@ -119,9 +119,32 @@ module Rails
# 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 @@ module Rails
"#{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