Using Rails 3.0.5 is it expected that
ruby-1.8.7-p302 > "KnownIP".tableize
=> "known_ips"
rather than "known_i_ps" as I had expected?
The result (at least I think it is the result of above) is that
rails g model KnownIP
provides a model class KnownIp in known_ip.rb, rather than KnownIP in
known_i_p.rb
Did your rails g generate the KnownIP model or the KnownIp model? Your post says both.
Oh, are you sure it says both?
...
The result (at least I think it is the result of above) is that
rails g model KnownIP
provides a model class KnownIp in known_ip.rb, rather than KnownIP in
known_i_p.rb
It produced a KnownIp model when one might expect it to produce
KnownIP. Having investigated further I am pretty sure the problem is
in ActiveSupport::Inflector#underscore, giving
However looking at the intro on [1] I see
"The Rails core team has stated patches for the inflections library
will not be accepted in order to avoid breaking legacy applications
which may be relying on errant inflections. If you discover an
incorrect inflection and require it for your application, you’ll need
to correct it yourself (explained below)."
So this may be a case of "that is just how it is".
However looking at the intro on [1] I see
"The Rails core team has stated patches for the inflections library
will not be accepted in order to avoid breaking legacy applications
which may be relying on errant inflections. If you discover an
incorrect inflection and require it for your application, you’ll need
to correct it yourself (explained below)."
So this may be a case of "that is just how it is".