A Pattern for STIs in Rails
The Problem Active Record provides STIs to easily work with hierarchies of (persisted) models. They have a few rough edges, however: Active Record needs to know the entire hierarchy to be able to build correct queries. This is at odds with lazy load...
Oct 31, 20223 min read1.3K