I am a Sr. Software Developer at Oracle Cloud. The opinions expressed here are my own and not necessarily those of my employer.
Single table inheritance
Often you have models with optional fields. And then you have to implement business logic that makes those fields required IF another field is set to specific value. Otherwise these fields are not allowed.
It’s pretty simple if you do it for one or two fields. But often you need to build custom business logic around those fields and things get messy.
One option is to split the logic between several classes.
With Mongoid it will automatically create _type field. With AR you will need to add the column manually. But now all your records are stored in the same table and you can define commong behavior and fields in the base class. You can read more here and here.