This should happen for mouse or louse, but not slice or pumice.
I know the inflector is "frozen," but this is a pretty cut and dry bug with a very simple fix. It doesn't seem likely that there are many cases out there where this bug fix will break existing code.
Fixes issue #4374.
fix inflector bug where -ice gets pluralized into -ouse
I have found another similar bug where "Pies" becomes "Py".
@cap10morgan If the inflector is frozen, then it seems like we shouldn't re-open it.
Confirmed, inflections in Rails are frozen, it won't accept more changes. If you need to handle that in your application, just add the required rules to your initializer file. Thanks!
I understand that the inflector is frozen against future additions. But surely it shouldn't be frozen against bug fixes. This issue should either be fixed or the offending inflections removed entirely. Doing nothing breaks Rails apps that hit this bug.
@cap10morgan the issue is: can we be sure that this change is not going to break other people's app because there are other words that would match the regexp but not they won't? How many words are we breaking and how many words are we fixing with this patch? If someone can run those regexps over a dictionary so we can get 20-ish sample words to have an idea, it would be awesome. Otherwise, I think we should not merge it.
$ egrep '(m|l)ouse$' /usr/share/dict/words
$ egrep '^(m|l)ouse$' /usr/share/dict/words
$ egrep '(m|l)ice$' /usr/share/dict/words
$ egrep '^(m|l)ice$' /usr/share/dict/words
It does appear that without this change, quite a few words would be wrong. Blouse => Blice for example.
@jasonnoble Thanks for doing that. I posted a similar list to the original issue here: #4374 (comment)
@jasonnoble nice, cool trick :)
ok, merging this, thanks everyone!
Merge pull request #5177 from cap10morgan/fix-gh-issue-4374
fix inflector bug where -ice gets singularized into -ouse