stryderjzw

stryderjzw

Having trouble understanding upsert documentation

Learning Ash and this is the part of the documentation that I’m having a bit of difficulty understanding:

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!

Marked As Solved

zachdaniel

zachdaniel

Creator of Ash

:wave: thanks for the great questions! I’ve pushed some new docs up which will be available in the next release. For now you can view the preview docs on GH pages: Create Actions — ash v3.29.3

One small note: that references error_handler being able to take a 2 arity anonymous function, but that will only be true on the next release. As of the current release only an MFA is supported.

Also Liked

stryderjzw

stryderjzw

Amazing! Much clearer examples. Thank you.

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement