An issue that has come up fairly regularly for us is that structs will map to an unintended classes when using auto_struct. One such case in when an association is aliased. Something like
# we want it to map to this class PostCategory end class Post < ROM::Relation[:posts] schema do associations do has_one :post_category, as: :category end end end # the hacky fix Category = PostCategory
What do you think about offering an option like:
entity_implementation PostCategory? I think this would be much more predictable and won’t fail in confusing ways. Thoughts?