warning: Changeset has already been validated for action :create.
I am getting this warning when trying to set an attribute before submitting a form, since this isn't user provided and I don't want to make the http call if this isn't going to be submitted, is there maybe another way to accomplish this as the warning says this will be an error in the future.
12 Replies
You could push this up to the resource with a default MFA. default MFAs (i'm pretty sure) only get called on submit
https://ash-hq.org/docs/dsl/ash-resource#attributes-attribute-default
ooooh
yeah i'd wait for confirmation on that!
You are correct
sweet
In this specific case, that warning is letting you know that you're using
change_attribute
but you've already validated the changeset. Its just informative.
To get around it, you should use force_change_attribute
nice
Its to prevent you from accidentally bypassing a validation on the resource
oh from the docs force just allows you to change a nonwritable attribute
didn't think it would apply in this case since it is a writable attribute
Yeah, we should probably add a snippet there
I like the default better though, thanks!
It does both essentially