Rails' inflections are messy

For anybody who shares my sentiment, until Rails core decides it’s time to clean up their inflections, I’ve published a gem to provide more sane default pluralization/singularization rules: https://github.com/davidcelis/inflections

Here’s the difference:

4 pluralization rules (down from 21)

5 singularization rules (down from 27)

3 irregularities (down from 7)

1 uncountable (down from 10)

Ahhh. Much better.

At least they should fix the ones that are incorrect…

“Octopus”.pluralize should return “Octopuses” and NOT “Octopi”… :slight_smile:

At least they should fix the ones that are incorrect...

"Octopus".pluralize should return "Octopuses" and NOT "Octopi"... :slight_smile:

But then all those applications that rely on the current pluralisation
of octopus would break when upgraded. Innumerable applications around
the internet would come to their knees.

Colin

So many applications!

But in seriousness, this IS a terrible argument, is it not? I’m not crazy, am I? There are CHANGELOGs and upgrade guides for a reason.

:slight_smile:

Surely all those sites' developers could just override the inflector
back to what it used to be, and get on with all the other tasks they
need to complete to upgrade to Rails4?

Yep, the point I’ve been getting at. People shouldn’t blindly upgrade their Rails versions anyway, and when they see errors that a Controller can’t be found based on their Model name or vice versa, it should be pretty obvious as to what’s going on unless they’re clueless about the inflector.

Any thoughts on this from core members, perhaps?