Hello I have this scenario (hope it is understandable):
I have a model to support fact messages of different types. This is
sport related and I have currently the following model design.
matchfacts (is the generic table connecting all matchfacts to for
instance a match/game, match has_many matchfacts).
Some matchfact-data is generic, like the time of fact and therefore the
data should be stored there.
Instead of making one table fits all, I want matchfacts to support
certain predefined types.
For instance: Goal, Substitution, Card and so on.
What is best practice here? Use the polymorphic feature or create a
model of each matchfact-type with a has_one connection to matchfacts
The next problem is that each matchfact-type will probably also need
either a enumeration or a matchfact-x-type model (where x is each
matchfact-type (example of types can be: Red,Yellow card-types). This
is to limit the different data beeing entered into model, but still
make it dynamic and changeable by web-admin not database-admin.