aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-06-17 21:22:52 -0700
committerwangjohn <wangjohn@mit.edu>2013-06-17 21:32:12 -0700
commit484ff7d29e7a27216219cf5460bf675c38abf522 (patch)
tree275a03ae96111ea0f074f2dde6ee0abc6534fe15 /railties
parentfa4cf9407c0a64d7c0a86da735b82aafb37f6866 (diff)
downloadrails-484ff7d29e7a27216219cf5460bf675c38abf522.tar.gz
rails-484ff7d29e7a27216219cf5460bf675c38abf522.tar.bz2
rails-484ff7d29e7a27216219cf5460bf675c38abf522.zip
Removing a repetitive comment and removing a deprecation warning.
The comment on the +env_config+ method is repetitive, likely to get outdated, and provides no useful information which cannot be gleamed from the code. I'm therefore removing it. I'm also refactoring the check for the presence of a secret_token in the configuration.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb31
1 files changed, 7 insertions, 24 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index a39ac304f2..b5c5a6191f 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -119,32 +119,9 @@ 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
- 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
+ validate_secret_key_config!
super.merge({
"action_dispatch.parameter_filter" => config.filter_parameters,
@@ -314,5 +291,11 @@ module Rails
"#{script_name}#{path_info}"
end
end
+
+ def validate_secret_key_config! #:nodoc:
+ if config.secret_key_base.blank? && config.secret_token.blank?
+ raise "You must set config.secret_key_base in your app's config."
+ end
+ end
end
end