aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-04-19 17:16:19 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-04-19 17:16:19 -0700
commitf67b070facef6574df3c4386e3975242273fe456 (patch)
treeab981fa986477afc88482a6b73c7049d7b132809
parent715db1a7973dfc02466207a913bacc4702187dad (diff)
downloadrails-f67b070facef6574df3c4386e3975242273fe456.tar.gz
rails-f67b070facef6574df3c4386e3975242273fe456.tar.bz2
rails-f67b070facef6574df3c4386e3975242273fe456.zip
Override incompatible 1.8.7p1 String#chars
-rw-r--r--activesupport/lib/active_support/core_ext/string/unicode.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/unicode.rb b/activesupport/lib/active_support/core_ext/string/unicode.rb
index 963920d4a6..1f50773505 100644
--- a/activesupport/lib/active_support/core_ext/string/unicode.rb
+++ b/activesupport/lib/active_support/core_ext/string/unicode.rb
@@ -4,6 +4,12 @@ module ActiveSupport #:nodoc:
unless '1.9'.respond_to?(:force_encoding)
# Define methods for handling unicode data.
module Unicode
+ def self.included(base)
+ if '1.8.7'.respond_to?(:chars)
+ base.class_eval { remove_method :chars }
+ end
+ end
+
# +chars+ is a Unicode safe proxy for string methods. It creates and returns an instance of the
# ActiveSupport::Multibyte::Chars class which encapsulates the original string. A Unicode safe version of all
# the String methods are defined on this proxy class. Undefined methods are forwarded to String, so all of the