I’ve got a relation called identities. I have another relation called activities. Activities has a belongs_to association called by, which is an alias for identities.
For some reason, the struct that by is mapped to is a By entity instead of Identity from the identities relation.
How do I get an assoociation to use the struct frrom the relation?
Struct inference uses relation names, so if they are aliased, which is what happens when you use belongs_to, a different name is used than the default one. You could workaround that like this:
Thanks @solnic, sorry I didn’t reply sooner. Seems a little odd that there isn’t an option to specify what it should be. I think a saw someone else recently post about to this as well.
Adding a dedicated option that would specify which entity name should be used can be done relatively easily. I guess it could be called struct_class, so ie: