Seeding multiple resources with inter-relationships
How do I do something like this in Ash? User and Post are Ash resources where a User has many posts. It doesn't seem to work as it does in Ecto.
2 Replies
If you're talking about doing actual data seeds, you can use
Ash.Seed
to do pretty much exactly that.
But if you're building out actions for your application, you'd use things like manage_relationship
, or custom behavior in an action of some other kind, to do the relationship changes.
and then
But IIRC, Ash.Seed.seed!(%User{....})
ought to behave the way you wantAwesome. Thank you, Zach!!