rails/rails — pull request #14799 by ernie (2014-04-18 18:59:22+00:00)
Title: Fix inconsistent behavior from String#first/#last

While calling String#first or String#last with zero or a Fixnum < the
string's length returns a new string, a Fixnum >= the string's length
returns the string itself. This inconsistency can lead to inadvertent
mutation of a string.