But there are a couple of exceptions, like schema_info and
schema_migrations. So I thought I’d check to see if the resulting
classifcation actually exists as a class, but I can only think of an
ugly way to check:
eval t.classify rescue nil # throws an exception if the class does
not exist
I remember vaguely that ActiveRecord keeps track of
all the models derived from it.
It had some protected method to get them all which you
could access with the send method.
Have a look in the ActiveRecord sources to get more details.
Another way to do it is that there is a ruby method called
const_defined? or something like that, you can google for it, and you
can check to see if the class name is defined.