File this under mild pedantry, but it's been bugging me. Assume I want
to store different kinds of fruit in an STI table. My approach works,
but I end up referring to "fruit_bases" throughout my code where I'd
really prefer just "fruits".
Robb: Pardon -- Although my code shows it, I should have stated
explicitly that I am sticking all the STI sub-classes in a Fruit module
and app/model/fruit subdirectory. I envision enough Fruit sub-classes
that I don't want them all in the toplevel app/model directory.
I did notice this. You can still stick fruit.rb, apple.rb and your other fruit classes in app/models/fruit and prevent automatic namespacing which you are working around with your module. It involves explicitly adding app/models/fruit to Rails’ autoload paths.
I am not entirely certain this is the cleanest, most Railsy way, but it was the poison I picked over the complexity of unnecessary modules or namespaces. I can live with a path added to config.