diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-17 08:22:26 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-12-17 08:22:26 -0800 |
commit | ae196e85ee7169700afac2eecdc276bc06b10b8d (patch) | |
tree | ea504d00de22f81a34b84cd5852e5f1dd043cb7c /guides/source | |
parent | 5d77edf0cf1ed653ed3f7729d77eeb8de219d0b3 (diff) | |
parent | 7c858b03a9de3c600594ca3c88540b14d835dd91 (diff) | |
download | rails-ae196e85ee7169700afac2eecdc276bc06b10b8d.tar.gz rails-ae196e85ee7169700afac2eecdc276bc06b10b8d.tar.bz2 rails-ae196e85ee7169700afac2eecdc276bc06b10b8d.zip |
Merge pull request #13341 from carlosantoniodasilva/ca-i18n
Default I18n.enforce_available_locales to true
We will default this option to true from now on to ensure users properly handle their list of available locales whenever necessary. This option was added as a security measure and thus Rails will follow it defaulting to secure option.
Also improve the handling of I18n config options in its railtie, taking the new enforce_available_locales option into account, by setting it as the last one in the process. This ensures no other configuration will trigger a deprecation warning due to that setting.
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index ca5623bf73..1c233b4d82 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -156,6 +156,23 @@ end ActiveRecord::FixtureSet.context_class.send :include, FixtureFileHelpers ``` +### I18n enforcing available locales + +Rails 4.1 now defaults the I18n option `enforce_available_locales` to `true`, +meaning that it will make sure that all locales passed to it must be declared in +the `available_locales` list. + +To disable it (and allow I18n to accept *any* locale option) add the following +configuration to your application: + +```ruby +config.i18n.enforce_available_locales = false +``` + +Note that this option was added as a security measure, to ensure user input could +not be used as locale information unless previously known, so it's recommended not +to disable this option unless you have a strong reason for doing so. + Upgrading from Rails 3.2 to Rails 4.0 ------------------------------------- |