Composite primary keys vs through
It looks like
destination/source_attribute_on_join_resource
both expect an atom. Is it possible to reference a composite key on a join table? I am trying to set up a many_to_many
relationship.6 Replies
Can you be more specific about the fields/relationships you're trying to set up?
Was looking into a
ExtOrg
(external organization) and User
many_to_many
relationship but the ExtOrg
has a composite primary key for uniqueness (platform + ext id). I can use an identity instead potentially to enforce that, but this is was sort of a "could I do this?" situationAh, yeah I don't think you reasonably can do it with many_to_many
Solution
But you can use a has_many with a filter
Search for Rebecca Le's blog post about relationships with filters in ash
Thanks! Hopefully I found the right one https://sevenseacat.net/posts/2024/through-relationships-with-ash/
Modelling
through
relationships with Ash | sevenseacat.netThey're not natively supported, but you can still make them!