From cfc9439454988a07451a7e261379569d135bcef5 Mon Sep 17 00:00:00 2001
From: Jeremy Kemper <jeremy@bitsweat.net>
Date: Fri, 11 Jun 2010 10:03:04 -0700
Subject: Explicitly delegate Chars#<=> to work around Kernel#<=> possibly
 ignoring method_missing

---
 activesupport/lib/active_support/multibyte/chars.rb | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'activesupport')

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 =~ /!$/
-- 
cgit v1.2.3