I often find myself duplicating many attributes and functionality across different serializers. Normally I'm able to remove duplication using inheritance with a common base serializer. However, inheritance isn't always a logical or best answer.
For example, with the popular `paper_trail` gem many non-related models end up with a similar has_many relationship to `Versions` model. Instead of putting `has_many :versions, embed: :ids, include: true` in every model with a paper trail, I could include a common Concern HasPaperTrail that manages the versions relationship.
Anytime a Concern or polymorphic relationship makes sense in ActiveModel, it might also make sense to use a common serilizer Concern to handle it's serilization.
Thoughts?
Thank you for reading,
-Daniel