From 11537c57cbf91c0514fac1c40bdf362ba5deef33 Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Wed, 27 Apr 2011 17:35:00 +0200 Subject: fixed a small bug with Array#from core_ext --- activesupport/lib/active_support/core_ext/array/access.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/array/access.rb') diff --git a/activesupport/lib/active_support/core_ext/array/access.rb b/activesupport/lib/active_support/core_ext/array/access.rb index 2bba0974b3..2df4fd1da1 100644 --- a/activesupport/lib/active_support/core_ext/array/access.rb +++ b/activesupport/lib/active_support/core_ext/array/access.rb @@ -6,7 +6,7 @@ class Array # %w( a b c d ).from(10) # => %w() # %w().from(0) # => %w() def from(position) - [position, length] || [] + self[position, length] || [] end # Returns the beginning of the array up to +position+. -- cgit v1.2.3