Avoid warnings by undefining the old method transliterate.

This commit is contained in:
Michael Koziarski 2008-10-14 21:23:27 +02:00
parent e0993c6c37
commit 3e9fc279e5
1 changed files with 1 additions and 0 deletions

View File

@ -279,6 +279,7 @@ module ActiveSupport
# The iconv transliteration code doesn't function correctly
# on some platforms, but it's very fast where it does function.
if "foo" != Inflector.transliterate("föö")
undef_method :transliterate
def transliterate(string)
string.mb_chars.normalize(:kd). # Decompose accented characters
gsub(/[^\x00-\x7F]+/, '') # Remove anything non-ASCII entirely (e.g. diacritics).