From 134dab46e4e94d7e6e37cec43dca8183fe72aea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Rodr=C3=ADguez?= Date: Mon, 15 Oct 2018 08:29:56 +0200 Subject: Deprecate ActiveSupport::Multibyte::Chars.consumes? In favor of String#is_utf8?. I think this method was made for internal use only, and its usage was removed here: https://github.com/rails/rails/pull/8261/files#diff-ce956ebe93786930e40f18db1da5fd46L39. --- activesupport/lib/active_support/multibyte/chars.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib/active_support/multibyte') diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 3e846271b2..424ffa993c 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -76,6 +76,11 @@ module ActiveSupport #:nodoc: # Returns +true+ when the proxy class can handle the string. Returns # +false+ otherwise. def self.consumes?(string) + ActiveSupport::Deprecation.warn(<<-MSG.squish) + ActiveSupport::Multibyte::Chars.consumes? is deprecated and will be + removed from Rails 6.1. Use string.is_utf8? instead. + MSG + string.encoding == Encoding::UTF_8 end -- cgit v1.2.3