mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
fix: properly upsert on non batchable rows
This commit is contained in:
parent
f3d201a211
commit
d2b54fdda9
1 changed files with 9 additions and 1 deletions
|
@ -809,8 +809,16 @@ defmodule Ash.Actions.Create.Bulk do
|
|||
})
|
||||
else
|
||||
[changeset] = batch
|
||||
upsert? = opts[:upsert?] || action.upsert? || false
|
||||
|
||||
case Ash.DataLayer.create(resource, changeset) do
|
||||
result =
|
||||
if upsert? do
|
||||
Ash.DataLayer.upsert(resource, changeset, upsert_keys)
|
||||
else
|
||||
Ash.DataLayer.create(resource, changeset)
|
||||
end
|
||||
|
||||
case result do
|
||||
{:ok, result} ->
|
||||
{:ok,
|
||||
[
|
||||
|
|
Loading…
Reference in a new issue