-------------------------------------------------------------------------------------------------
Mark Bates
ma...@mackframework.com
http://www.mackframework.com
http://api.mackframework.com/
http://github.com/markbates/mack
I definitely agree with Sam on this one. Let's see if there's a better
model out there for doing them. The company I work for uses them all
the time. Adam French and I had long discussions about polymorphic
associations at RailsConf, but we didn't really come up with anything
good. The one thing that really bugs my DBA is the string column for
the name of the class. We've hacked around it so we could use ints,
and we just keep a table that lists the classes, so we can do the
reverse mapping. It's not the best solution, but when you're using AR,
nothing really is. :)
-------------------------------------------------------------------------------------------------
Mark Bates
ma...@mackframework.com
http://www.mackframework.com
http://api.mackframework.com/
http://github.com/markbates/mack
The benefit is efficiency in the database. If you have 10 million rows and they're all storing the value "User" that's a lot of data versus them all storing the int 1. That's the advantage, it's more performent and efficient. That's all.
-------------------------------------------------------------------------------------------------Mark Bates