diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/access.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index eff31e5493..1a0b10b4f6 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -62,7 +62,7 @@ class String # str.from(1).to(-2) # => "ell" def to(position) position += size if position < 0 - self[0, position + 1].to_s + self[0, position + 1] || +"" end # Returns the first character. If a limit is supplied, returns a substring |