class String
def classify
"business".classify # => "Busines"
Singular names are not handled correctly.
"posts".classify # => "Post"
"egg_and_hams".classify # => "EggAndHam"
follow +classify+ with +constantize+.)
Note that this returns a string and not a class. (To convert to an actual class
Create a class name from a plural table name like Rails does for table names to models.
#
def classify ActiveSupport::Inflector.classify(self) end