diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-06-11 10:03:04 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-06-11 10:03:23 -0700 |
commit | cfc9439454988a07451a7e261379569d135bcef5 (patch) | |
tree | 544643785a2201a0ea3ca2539b5e1b0d79c52015 /activesupport/lib | |
parent | 85cc1fa657f441417f36998a32a6a158c2697aad (diff) | |
download | rails-cfc9439454988a07451a7e261379569d135bcef5.tar.gz rails-cfc9439454988a07451a7e261379569d135bcef5.tar.bz2 rails-cfc9439454988a07451a7e261379569d135bcef5.zip |
Explicitly delegate Chars#<=> to work around Kernel#<=> possibly ignoring method_missing
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/multibyte/chars.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 1eb6e8748b..d6ccb4bac1 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -34,7 +34,6 @@ module ActiveSupport #:nodoc: # # ActiveSupport::Multibyte.proxy_class = CharsForUTF32 class Chars - attr_reader :wrapped_string alias to_s wrapped_string alias to_str wrapped_string @@ -45,14 +44,16 @@ module ActiveSupport #:nodoc: @wrapped_string = string @wrapped_string.force_encoding(Encoding::UTF_8) unless @wrapped_string.frozen? end - - undef <=> else def initialize(string) #:nodoc: @wrapped_string = string end end + def <=>(other) + @wrapped_string <=> other + end + # Forward all undefined methods to the wrapped string. def method_missing(method, *args, &block) if method.to_s =~ /!$/ |