Pull request/discussion here: https://github.com/rails/rails/pull/7134

(I'm not talking about adding inflector rules here, I'm aware the rules are 
frozen.)

Summary of the ticket:

I ran into an inflector bug lately. The root of the problem seems to be that no 
one really knows what singularize/pluralize is supposed to take as arguments, 
and different part of Rails started making different assumptions about it:

1. The writer of the inflector rules assumed singularize/pluralize should take 
a single word as an argument, and starting writing rules like /^…$/i

2. The tests say it should work with "multi-world phrases" 

3. tableize says it should work with "underscore_seperated_phrases" (this is 
important because ActiveRecord relies on this)

4. The documentation says it should work with CamelCasePhrases as well, but 
there are no tests for these at all

As a result, nothing really works correctly right now. It worked okay most of 
the time, but that's more or less a miracle, and new commits keep changing the 
behaviour for certain not-so-uncommon test cases. Fixing this manually (it's 
more like hacking around the problem) by adding your custom inflector rules is 
non-trivial. (See the Github ticket for details.)

I have a fix ready for this (attached in the PR) but it will likely change the 
behaviour of tableize (which we already broke in master btw - and actually it's 
pretty much been broken all along, see ticket), so it could in theory break 
some apps out there.

Because of the potential impact, your feedback on this is much appreciated.

Thanks!
Godfrey

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to