From 1ff22133139b3c8aa4fb9b691b677aa0e697ea77 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 20 Dec 2018 21:19:41 -0200 Subject: 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 --- actionview/lib/action_view/helpers/text_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib/action_view/helpers/text_helper.rb') 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) -- cgit v1.2.3