It seems that with Rails/AR and the Inflector
methods added to String
by ActiveSupport
, I would expect that by default,
Nested::ClassDerived::FromAR.name.tableize == Nested::ClassDerived::FromAR.table_name
But actually tableize
calls underscore
, and underscore
doesn't actually underscore the ::
nested class separator, instead replacing it with a /
to make a pathname. Perhaps this method should be called pathify
?
Anyway, I need actual underscores. So I'm thinking of defining a new String
inflector method:
def new_inflector
underscore.gsub('/', '_')
end
that would actually underscore the nested class name string.
So, my question is, what is the proper inflection of 'underscore
' in order to properly and conventionally name my new inflector method, without configuration. Would it be 'underscoreize
' (following the convention established by 'tableize
') or 'underscorize
'? Or perhaps underscoreify
?
Any insight appreciated.