You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifically, the order of events will be different.
Using onSave, Wheels will run your custom validation first, then automatic validations. Using onCreate, it will run automatic validations first.
This is because of the way validations are stored in two separate arrays in variables.wheels.class.validations.
In the example of the app I am currently working on, it was failing create validation when using onCreate but passing when using onSave, because of this ordering issue, when it should make no difference. I could code around it, but it could really confuse someone less familiar with Wheels than I am.
The text was updated successfully, but these errors were encountered:
I've found some odd behaviour which I think should be considered a bug.
When creating custom validations, your app may behave differently depending on whether you use
<cfset validate(methods="validateProperties", when="onCreate")>
or
<cfset validate(methods="validateProperties", when="onSave")>
Specifically, the order of events will be different.
Using onSave, Wheels will run your custom validation first, then automatic validations. Using onCreate, it will run automatic validations first.
This is because of the way validations are stored in two separate arrays in variables.wheels.class.validations.
In the example of the app I am currently working on, it was failing create validation when using onCreate but passing when using onSave, because of this ordering issue, when it should make no difference. I could code around it, but it could really confuse someone less familiar with Wheels than I am.
The text was updated successfully, but these errors were encountered: