Rails delegated_type
Rails 6.1 added delegated_type for the ones who like polymorphic relations. So in addition to set a regular polymorphic relation in rails you can also call delegated_type
method to inject a bunch of useful methods and scopes for you. Check this out:
And this will produce helper methods like:
Tweet