2 Matching Annotations
  1. Feb 2022
    1. The existence of polymorphic associations does not allow the database to enforce referential integrity, however, because no foreign keys can be defined.
    2. Good point. In my example, cardinalities would be fundamentally different: an Entry could have_many :messages and have_many :comments. In the original example, a Message could have_many :entries, etc. In either case, there's no way to enforce the cardinalities at the database level (not that I'm aware of).