[Nitro] [PATCH][BUGFIX] Camel cases in class names are not handled correctly

TRANS transfire at gmail.com
Wed Apr 5 17:55:12 EDT 2006


Not sure what your solution was. I notice the suggeston of using:

  "#{klass.to_s.demodulize.underscore.downcase}_oid"

I think #demodulize is really a misnomer. It is just an alias for
#basename (and was derived from Rails). So you loose the module
namespace of the class. Perhaps that it's what it desired, but might
it not be dangerous?

  class Red::Fish

  class Blue::Fish

Will both map to table 'fish', yes?

If that's not what is wanted, you might try:

   "#{klass.to_s.methodize}_oid"

#methodize is actually the opposite of modulize --hence why I think
demodulize is a misnomer.

T.




More information about the Nitro-general mailing list