aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/core_ext/string/conversions.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/conversions.rb b/activesupport/lib/active_support/core_ext/string/conversions.rb
index 857ecfaa54..5b2cb6e331 100644
--- a/activesupport/lib/active_support/core_ext/string/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/string/conversions.rb
@@ -28,9 +28,8 @@ class String
self[0]
end unless method_defined?(:ord)
- def getbyte(index)
- self[index]
- end unless method_defined?(:getbyte)
+ # +getbyte+ backport from Ruby 1.9
+ alias_method :getbyte, :[] unless method_defined?(:getbyte)
# Form can be either :utc (default) or :local.
def to_time(form = :utc)