1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

String already respond_to scrub at Ruby 2.2

This commit is contained in:
Rafael Mendonça França 2015-01-04 15:46:42 -03:00
parent dc6efd387f
commit 065c20890a

View file

@ -211,9 +211,8 @@ module ActiveSupport
codepoints
end
# Ruby >= 2.1 has String#scrub, which is faster than the workaround used for < 2.1.
# Rubinius' String#scrub, however, doesn't support ASCII-incompatible chars.
if '<3'.respond_to?(:scrub) && !defined?(Rubinius)
if !defined?(Rubinius)
# Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent
# resulting in a valid UTF-8 string.
#