Skip to content

Commit

Permalink
Improve secret_token deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Dec 30, 2012
1 parent 257b3f6 commit 219e831
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions railties/lib/rails/application.rb
Expand Up @@ -135,9 +135,10 @@ def key_generator
def env_config def env_config
@env_config ||= begin @env_config ||= begin
if config.secret_key_base.nil? if config.secret_key_base.nil?
ActiveSupport::Deprecation.warn "You didn't set config.secret_key_base. " + ActiveSupport::Deprecation.warn "You didn't set config.secret_key_base in config/initializers/secret_token.rb file. " +
"This should be used instead of the old deprecated config.secret_token. " + "This should be used instead of the old deprecated config.secret_token in order to use the new EncryptedCookieStore. " +
"Set config.secret_key_base instead of config.secret_token in config/initializers/secret_token.rb" "To convert safely to the encrypted store (without losing existing cookies and sessions), see http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#action-pack"

if config.secret_token.blank? if config.secret_token.blank?
raise "You must set config.secret_key_base in your app's config" raise "You must set config.secret_key_base in your app's config"
end end
Expand Down

4 comments on commit 219e831

@spastorino
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spastorino
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need a CONSTANT for guides url
in master Rails::GUIDES_URL = "http://edgeguides.rubyonrails.org"
in *-stable Rails::GUIDES_URL = "http://guides.rubyonrails.org"
and as part of the release process when we create *-stable branches we would need to change from edgeguides to guides

@spastorino
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @tenderlove

We are pointing from the code mostly to guides.rubyonrails.org but here and here we are not

@spastorino
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed it for now 3755a49 unsure if the constant worth

Please sign in to comment.