diff options
author | Vinicius Stock <vinistock@users.noreply.github.com> | 2018-12-20 21:19:41 -0200 |
---|---|---|
committer | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-12-21 08:19:41 +0900 |
commit | 1ff22133139b3c8aa4fb9b691b677aa0e697ea77 (patch) | |
tree | 7a2da8d5cf97aa7d7c1bce3db408307c92f8814e /actionview/lib/action_view | |
parent | 788bc21ef38696bbcf732a7406de42c42eb05199 (diff) | |
download | rails-1ff22133139b3c8aa4fb9b691b677aa0e697ea77.tar.gz rails-1ff22133139b3c8aa4fb9b691b677aa0e697ea77.tar.bz2 rails-1ff22133139b3c8aa4fb9b691b677aa0e697ea77.zip |
Fix integer regex deprecation warnings for Ruby 2.6.0 (#34728)
* Fix integer regex deprecation warnings for Ruby 2.6.0
* Define =~ in FakeZone to avoid warnings from Ruby 2.6.0
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/text_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb index 3d378dcb2f..c282505e13 100644 --- a/actionview/lib/action_view/helpers/text_helper.rb +++ b/actionview/lib/action_view/helpers/text_helper.rb @@ -228,7 +228,7 @@ module ActionView # pluralize(2, 'Person', locale: :de) # # => 2 Personen def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale) - word = if count == 1 || count =~ /^1(\.0+)?$/ + word = if count == 1 || count.to_s =~ /^1(\.0+)?$/ singular else plural || singular.pluralize(locale) |