Skip to content

Deprecate the keys for association restrict_dependent_destroy errors in favor of new key names#20668

Merged
rafaelfranca merged 1 commit into
rails:masterfrom
repinel:rename-restrict-dependent-destroy-i18n-key
Jul 21, 2015
Merged

Deprecate the keys for association restrict_dependent_destroy errors in favor of new key names#20668
rafaelfranca merged 1 commit into
rails:masterfrom
repinel:rename-restrict-dependent-destroy-i18n-key

Conversation

@repinel

@repinel repinel commented Jun 23, 2015

Copy link
Copy Markdown
Member

As suggested by #11658 (comment), it deprecates the restrict_dependent_destroy errors keys in favor of better key names.

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'.

@rafaelfranca Is this what you expected?

Closes #11658

@repinel repinel force-pushed the rename-restrict-dependent-destroy-i18n-key branch 3 times, most recently from 9911b08 to f13500c Compare June 30, 2015 00:43
@repinel

repinel commented Jul 10, 2015

Copy link
Copy Markdown
Member Author

@rafaelfranca What do you think?

@repinel repinel force-pushed the rename-restrict-dependent-destroy-i18n-key branch from f13500c to fd3a8c2 Compare July 21, 2015 02:48
@repinel

repinel commented Jul 21, 2015

Copy link
Copy Markdown
Member Author

@rafaelfranca Is this one still valid?

(sorry for the multiples pings)

@rafaelfranca

Copy link
Copy Markdown
Member

(sorry for the multiples pings)

No problem at all. I way back in my backlog lately.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

New hash syntax.

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]
@repinel repinel force-pushed the rename-restrict-dependent-destroy-i18n-key branch from fd3a8c2 to b184398 Compare July 21, 2015 03:20
@repinel

repinel commented Jul 21, 2015

Copy link
Copy Markdown
Member Author

@rafaelfranca I fixed the hash syntax.

rafaelfranca added a commit that referenced this pull request Jul 21, 2015
…roy-i18n-key

Deprecate the keys for association `restrict_dependent_destroy` errors in favor of new key names
@rafaelfranca rafaelfranca merged commit 36ea89a into rails:master Jul 21, 2015
@repinel

repinel commented Jul 21, 2015

Copy link
Copy Markdown
Member Author

💚 💛 💙

@repinel repinel deleted the rename-restrict-dependent-destroy-i18n-key branch July 21, 2015 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants