In the simple case, this means that polymorphic *_type fields reference the tables in the schema instead of Ruby classes. This decouples the db schema from the Rails/Ruby framework, which is especially important when designing db schemas that will not be restricted to Rails use.
Example:
A Statistic references a StatHolder which can be either a Player or a Team. In the db schema, we'd have statistics, players, and teams tables. Then, statistics.stat_holder_type would be either "players" or "teams". We'd be referencing the tables, not the Ruby objects.
Is this useful to anybody else? Are there any drawbacks to this approach?
Josh Harvey
http://shnoo.gr
http://xmlteam.com
_______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core