I get the following error when trying to use the built in string_length validation on an update action:
** (Ash.Error.Unknown)
Bread Crumbs:
Exception raised in: Module.change_secret
Unknown Error
(KeyError) key :atomics not found in: {:not_atomic,
"Failed to validate expression string_length(secret) > 64: “Invalid reference “secret””}
My update action looks like this:
update :change_secret do
argument :secret, :string, allow_nil?: false
validate string_length(:secret, min: 8, max: 64)
change {HashSecret, argument: :secret, field: :hashed_secret}
end
It looks like ash/lib/ash/resource/validation/string_length.ex at main · ash-project/ash · GitHub has the atomic function so I’m not sure what I’m doing wrong. (The create works as expected with the validation and the custom HashSecret change working well.)