lib/active_support/multibyte/chars.rb in activesupport-7.1.5 vs lib/active_support/multibyte/chars.rb in activesupport-7.2.0.beta1

- old
+ new

@@ -57,11 +57,11 @@ @wrapped_string = string @wrapped_string.force_encoding(Encoding::UTF_8) unless @wrapped_string.frozen? end # Forward all undefined methods to the wrapped string. - def method_missing(method, *args, &block) - result = @wrapped_string.__send__(method, *args, &block) + def method_missing(method, ...) + result = @wrapped_string.__send__(method, ...) if method.end_with?("!") self if result else result.kind_of?(String) ? chars(result) : result end