diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-09-21 17:54:36 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-09-21 17:54:39 -0700 |
commit | 12d06dd91dd189df73186b0f537301dbac8af2e2 (patch) | |
tree | 13f378db09421371b0e209d2c16b8407aa41f261 /actionview/lib | |
parent | 19966242163611e61d45ee4033f28aa6f967906a (diff) | |
download | rails-12d06dd91dd189df73186b0f537301dbac8af2e2.tar.gz rails-12d06dd91dd189df73186b0f537301dbac8af2e2.tar.bz2 rails-12d06dd91dd189df73186b0f537301dbac8af2e2.zip |
Undeprecate plural positional argument
```ruby
pluralize people.count, 'person', 'people'
```
reads more naturally than
```ruby
pluralize people.count, 'person', plural: 'people'
```
so let's not deprecate it.
We could label both, but that's a mouthful:
```ruby
pluralize people.count, singular: 'person', plural: 'people'
```
(The `plural:` kwarg shipped in 5.0.0, so we're keeping it.)
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/helpers/text_helper.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/actionview/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb index 0fea4df09c..bd3371ccc8 100644 --- a/actionview/lib/action_view/helpers/text_helper.rb +++ b/actionview/lib/action_view/helpers/text_helper.rb @@ -225,14 +225,7 @@ module ActionView # # pluralize(2, 'Person', locale: :de) # # => 2 Personen - def pluralize(count, singular, deprecated_plural = nil, plural: nil, locale: I18n.locale) - if deprecated_plural - ActiveSupport::Deprecation.warn("Passing plural as a positional argument " \ - "is deprecated and will be removed in Rails 5.1. Use e.g. " \ - "pluralize(1, 'person', plural: 'people') instead.") - plural ||= deprecated_plural - end - + def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale) word = if (count == 1 || count =~ /^1(\.0+)?$/) singular else |