aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2012-11-28 13:57:07 -0800
committerSteve Klabnik <steve@steveklabnik.com>2012-11-28 13:58:51 -0800
commitbd852603a18a3a9d20597382a97f9b0f5bb0fc94 (patch)
tree00c6d3415b4a90e3700a21bf73aafb88cc7e9936 /activesupport/lib/active_support/core_ext/string
parent27b79f4c911fdfce186086cfaa6646f1c2083aa0 (diff)
downloadrails-bd852603a18a3a9d20597382a97f9b0f5bb0fc94.tar.gz
rails-bd852603a18a3a9d20597382a97f9b0f5bb0fc94.tar.bz2
rails-bd852603a18a3a9d20597382a97f9b0f5bb0fc94.zip
Simplify String#mb_chars and stop proxying #class
This behavior mattered under Ruby 1.8, but that doesn't matter now that we don't support it. In addition, we don't want to proxy the #class method. A test was added to prevent against regressions.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string')
-rw-r--r--activesupport/lib/active_support/core_ext/string/multibyte.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/multibyte.rb b/activesupport/lib/active_support/core_ext/string/multibyte.rb
index 0ea5fe3571..a124202936 100644
--- a/activesupport/lib/active_support/core_ext/string/multibyte.rb
+++ b/activesupport/lib/active_support/core_ext/string/multibyte.rb
@@ -33,11 +33,7 @@ class String
# For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For
# information about how to change the default Multibyte behavior see ActiveSupport::Multibyte.
def mb_chars
- if ActiveSupport::Multibyte.proxy_class.consumes?(self)
- ActiveSupport::Multibyte.proxy_class.new(self)
- else
- self
- end
+ ActiveSupport::Multibyte.proxy_class.new(self)
end
def is_utf8?