rails/rails — pull request #7134 by chancancode (2012-07-23 09:44:07+00:00)
Title: Correctly apply inflection rules on uncountable multi-word strings. (Fixes #7132)

Currently, apply_inflections does not take into account that the input might be a multi-word string separated by underscore. (tableize etc relies on this behavior to work correctly.) This bug affects only uncountable multi-word strings separated by underscores:

"funky jeans".singularize # => "funky jeans"
"client information".pluralize # => "client information"

"funky_jeans".singularize # => "funky_jean"
"client_information".pluralize # => "client_informations"

It's also worth pointing out that "funky_jeans".singularize used to work correctly before 9b4622a483319f3d1e7f4489442f0d86afb6da36, which was merged almost 2 years ago so this is essentially broken since Rails 3.

On the other hand, it appears that "client_information".pluralize has always been broken, so this does change the behavior of tableize and could potentially break some older apps out there.

Closes #7132.