Learning Ash and this is the part of the documentation that I’m having a bit of difficulty understanding:
https://hexdocs.pm/ash/create-actions.html#upserts
In the first example, it’s a :create_user create action that will update the email if it exists? But if the user with the email already exists, then it won’t ever update anything in this case since it only accepts email?
In the Targeting Upserts section,
- with the first example, if the slug already exists, shouldn’t it run the update? Why does the documentation say the upsert will fail?
- with the
filter
on change, we’re just saying that we’re removing other user’s articles out of the query, so only the current user’s articles can be affected? - Where does the :id come from in
^actor(:id)
?
Much appreciated!