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
|
@impl true
|
||||||
def atomic(changeset, opts) do
|
def atomic(changeset, opts) do
|
||||||
value =
|
value =
|
||||||
case Changeset.fetch_argument_or_change(changeset, opts[:attribute]) do
|
case Ash.Changeset.fetch_argument_or_change(changeset, opts[:attribute]) do
|
||||||
{:ok, value} ->
|
{:ok, value} ->
|
||||||
value
|
value
|
||||||
|
|
||||||
:error ->
|
:error ->
|
||||||
Changeset.atomic_ref(changeset, opts[:attribute])
|
Ash.Changeset.atomic_ref(changeset, opts[:attribute])
|
||||||
end
|
end
|
||||||
|
|
||||||
{:atomic, [opts[:attribute]], Ash.Expr.expr(^value not in ^opts[:values]),
|
{:atomic, [opts[:attribute]], Ash.Expr.expr(^value not in ^opts[:values]),
|
||||||
Ash.Expr.expr(
|
Ash.Expr.expr(
|
||||||
error(
|
error(
|
||||||
Ash.Error.Changes.InvalidAttribute,
|
Ash.Error.Changes.InvalidAttribute,
|
||||||
|
%{
|
||||||
field: ^opts[:attribute],
|
field: ^opts[:attribute],
|
||||||
value: ^value,
|
value: ^value,
|
||||||
message: "expected one of %{values}",
|
message: "expected one of %{values}",
|
||||||
vars: [values: Enum.map_join(opts[:values], ", ", &to_string/1)]
|
vars: [values: Enum.map_join(opts[:values], ", ", &to_string/1)]
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue