aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/locale
diff options
context:
space:
mode:
authorRoque Pinel <repinel@gmail.com>2015-06-22 22:28:57 -0400
committerRoque Pinel <repinel@gmail.com>2015-07-20 23:19:43 -0400
commitb184398b5359da5b76367aa61551d0f3d7e99fc5 (patch)
tree1856972e8a55547961795097f6acda9b4144996f /activerecord/lib/active_record/locale
parent51d333ae5a353ee8fa827fc5c96780d66174e932 (diff)
downloadrails-b184398b5359da5b76367aa61551d0f3d7e99fc5.tar.gz
rails-b184398b5359da5b76367aa61551d0f3d7e99fc5.tar.bz2
rails-b184398b5359da5b76367aa61551d0f3d7e99fc5.zip
Deprecate and rename the keys for association restrict_dependent_destroy
Previously `has_one` and `has_many` associations were using the `one` and `many` keys respectively. Both of these keys have special meaning in I18n (they are considered to be pluralizations) so by renaming them to `has_one` and `has_many` we make the messages more explicit and most importantly they don't clash with linguistical systems that need to validate translation keys (and their pluralizations). The `:'restrict_dependent_destroy.one'` key should be replaced with `:'restrict_dependent_destroy.has_one'`, and `:'restrict_dependent_destroy.many'` with `:'restrict_dependent_destroy.has_many'`. [Roque Pinel & Christopher Dell]
Diffstat (limited to 'activerecord/lib/active_record/locale')
-rw-r--r--activerecord/lib/active_record/locale/en.yml4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/locale/en.yml b/activerecord/lib/active_record/locale/en.yml
index 8a3c27e6da..0b35027b2b 100644
--- a/activerecord/lib/active_record/locale/en.yml
+++ b/activerecord/lib/active_record/locale/en.yml
@@ -16,8 +16,8 @@ en:
messages:
record_invalid: "Validation failed: %{errors}"
restrict_dependent_destroy:
- one: "Cannot delete record because a dependent %{record} exists"
- many: "Cannot delete record because dependent %{record} exist"
+ has_one: "Cannot delete record because a dependent %{record} exists"
+ has_many: "Cannot delete record because dependent %{record} exist"
# Append your own errors here or at the model/attributes scope.
# You can define own errors for models or model attributes.