From 9ccc5e104287e45b21e4129991b1e507aa1a7dff Mon Sep 17 00:00:00 2001 From: Hugo Vacher Date: Mon, 11 Mar 2019 13:42:38 -0400 Subject: Update Changelog with new locale fallback behavior on validation --- activemodel/CHANGELOG.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'activemodel/CHANGELOG.md') diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index a644c63992..d7586f60ed 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -1,3 +1,27 @@ + +* Changed how validation error translation strings are fetched: The new behaviour + will first try the more specific keys, including doing locale fallback, then try + the less specific ones. + + For example this is the order keys will now be tried for a `blank` error on a + `product`'s `title` attribute with current locale set to `en-US`: + + en-US.activerecord.errors.models.product.attributes.title.blank + en-US.activerecord.errors.models.product.blank + en-US.activerecord.errors.messages.blank + + en.activerecord.errors.models.product.attributes.title.blank + en.activerecord.errors.models.product.blank + en.activerecord.errors.messages.blank + + en-US.errors.attributes.title.blank + en-US.errors.messages.blank + + en.errors.attributes.title.blank + en.errors.messages.blank + + *Hugo Vacher* + ## Rails 6.0.0.beta2 (February 25, 2019) ## * Fix date value when casting a multiparameter date hash to not convert -- cgit v1.2.3