It looks like using the Rails / AR and methods Inflectoradded to Stringon ActiveSupport, I would expect that by default
Nested::ClassDerived::FromAR.name.tableize == Nested::ClassDerived::FromAR.table_name
But it actually tableizecalls underscore, but underscoredoesn't really emphasize, the ::nested class separator, instead replacing it /to create a path. Perhaps this method should be called pathify?
Anyway, I need actual underscores. So Iām thinking about defining a new inflector method String:
def new_inflector
underscore.gsub('/', '_')
end
which would actually underline the name string of the nested class.
So, my question is: what is the correct inflection ' underscore' to correctly and conditionally call my new inflector method, without configuration. Will it be " underscoreize" (according to the agreement established by " tableize") or " underscorize"? Or maybe underscoreify?
Any insight was appreciated.
source
share