When looking at comments which will be made on different types (say
post, picture, article) I see a lot of advice towards using polymorphic
associations for this. Ryan B. has a good railscast on it:
However, I’m not sure I see why this is such a good idea in this case.
Would it not make more sense to have multiple comment types:
PostComment < Comment
PictureComment < Comment
Now we have the same amount of comment rows and we maintain referential
integrity, although we do now have more tables…
Can someone point me in the direction of why polymorphic associations
are the way to go rather than using inheritance and multiple tables in
the db? Does it make much difference?