chore: fix error code in embeddable type

This commit is contained in:
Zach Daniel 2024-08-07 22:57:31 -04:00
parent 201687163f
commit beb8ff7602

View file

@ -744,21 +744,28 @@ defmodule Ash.EmbeddableType do
|> if do
:ok
else
{:not_atomic,
"""
Embedded attributes do not support atomic updates unless one of the following is true:
- it has no primary key
- `constraints[:on_update]` is set to `:replace`
Or all of the following are true:
- the update action accepts all public attributes and has no changes
- there are no changes or validations on the action
- there are no notifiers, or relationships defined on the resource """}
"""
:error
end
else
:error
end
|> case do
:ok ->
:ok
:error ->
{:not_atomic,
"""
Embedded attributes do not support atomic updates unless one of the following is true:
- it has no primary key
- `constraints[:on_update]` is set to `:replace`
Or all of the following are true:
- the update action accepts all public attributes and has no changes
- there are no changes or validations on the action
- there are no notifiers, or relationships defined on the resource """}
"""}
end
end