Open OscarGodson opened 9 years ago
Weird, it looks like beforeValidate
is getting called in the right place in the lifecycle:
https://github.com/geddy/model/blob/master/lib/index.js#L730
This is at the top, before it begins calling validateProperty
on each prop. It should be working right.
I'm pretty sure this code in the docs doesn't work (its under https://github.com/geddy/model#lifecycle-events):
Note that it's not returning anything nor does it set any params on any object like
this.params
. I didn't see any specs that actually check for this, but I could be missing it.When I try that in my code my default params arent updated. If I have this code:
I still get an error:
For now I can use
afterCreate
and set it asrequired: false
(since I'll be forcing a value ifnull
). I can update the docs if the above is indeed incorrect. I couldn't figure out the right syntax tho.