rails/rails — pull request #16535 by bf4 (2014-08-18 02:54:24+00:00)
Title: Allow fallback to LegacyKeyGenerator when secret_key_base is not set

Let devs upgrading from older Rails take advantage of the LegacyKeyGenerator without needing a monkeypatch to use a blank secret_key_base

This behavior may have been removed by accident. See https://github.com/rails/rails/commit/484ff7d29e7a27216219cf5460bf675c38abf522

e.g.

```ruby
Rails::Application.class_eval do
# the key_generator will then use ActiveSupport::LegacyKeyGenerator.new(config.secret_token)
fail "I'm sorry, Dave, there's no :validate_secret_key_config!" unless instance_method(:validate_secret_key_config!)
def validate_secret_key_config! #:nodoc:
config.secret_token = secrets.secret_token
if config.secret_token.blank?
raise "Missing `secret_token` for '#{Rails.env}' environment, set this value in `config/secrets.yml`"
end
end
end
```