Ash FrameworkAF
Ash Framework8mo ago
6 replies
Quentin

Create a ressource with multiple relationships

The docs specifiy how to create a post -> comments relationship (so in the same direction as the has_many relationship

But I couldn't find how to create a ressource that has multiple belongs_to

With the post -> comments example,

How would you create a comment that has more that one required relationship?

Example:

comment_created_by -> User
comment_post -> Post
comment_category (?) -> CommentCategory
Solution
And write the ids. Or you can use the argument + manage_relationship pattern which you can see in the relationships guide
Was this page helpful?