So, basically I have a resource that has an attribute that allows nil values, but I want to have a AshPhoenix.Form that will consider that attribute as if it can’t be nil.
In Ecto I would probably just create a different changeset function that will enforce that attribute as required.
change fn changeset, _ ->
case Ash.Changeset.fetch_argument(changeset, :argument_name) do
{:ok, _} -> changeset
:error -> Ash.Changeset.set_argument(changeset, changeset.data.argument_name)
end
end