mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
chore: fix typo
This commit is contained in:
parent
5b222f9a68
commit
af9c78c2f6
1 changed files with 8 additions and 6 deletions
|
@ -56,22 +56,24 @@ defmodule Ash.Resource.Validation.OneOf do
|
|||
@impl true
|
||||
def atomic(changeset, opts) do
|
||||
value =
|
||||
case Changeset.fetch_argument_or_change(changeset, opts[:attribute]) do
|
||||
case Ash.Changeset.fetch_argument_or_change(changeset, opts[:attribute]) do
|
||||
{:ok, value} ->
|
||||
value
|
||||
|
||||
:error ->
|
||||
Changeset.atomic_ref(changeset, opts[:attribute])
|
||||
Ash.Changeset.atomic_ref(changeset, opts[:attribute])
|
||||
end
|
||||
|
||||
{:atomic, [opts[:attribute]], Ash.Expr.expr(^value not in ^opts[:values]),
|
||||
Ash.Expr.expr(
|
||||
error(
|
||||
Ash.Error.Changes.InvalidAttribute,
|
||||
%{
|
||||
field: ^opts[:attribute],
|
||||
value: ^value,
|
||||
message: "expected one of %{values}",
|
||||
vars: [values: Enum.map_join(opts[:values], ", ", &to_string/1)]
|
||||
}
|
||||
)
|
||||
)}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue