rails/rails — pull request #12050 by hderms (2013-08-27 22:07:36+00:00)
Title: Add Range#limit(value) to core_ext

Add method to simplify ensuring a value is within a given range. When it
is greater than the maximum, return the maximum. When it is greater than
the minimum, return the minimum. Otherwise, return the original value.

Also included are tests for the functionality, and an updated changelog
to reflect the functionality.
Add tests

Add core extension for Range.limit

Add to changelog