Great write-up! One other way I would maybe handle the need to check for those fields' existence is by having another function clause for mathematical_validation/1:
This cleans up the actual logic for this function, of course this wouldn't work I guess if you didn't have the validate_required check before it in the pipeline, so it all kinda depends on the requirement. Mostly I just wanted to say hiiii, long time no talk :)
Yeah, I think I started with something like this, but the feedback in the PR was that if other, unrelated validations were inserted in the wrong place in the pipeline then the errors field might show a false positive, leading to this custom function not running at all.
But, it obviously wasn't too bad of an idea if thats what you thought too!
Sorry for the late response, kind of dropped the ball.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great write-up! One other way I would maybe handle the need to check for those fields' existence is by having another function clause for
mathematical_validation/1
:This cleans up the actual logic for this function, of course this wouldn't work I guess if you didn't have the validate_required check before it in the pipeline, so it all kinda depends on the requirement. Mostly I just wanted to say hiiii, long time no talk :)
Yeah, I think I started with something like this, but the feedback in the PR was that if other, unrelated validations were inserted in the wrong place in the pipeline then the
errors
field might show a false positive, leading to this custom function not running at all.But, it obviously wasn't too bad of an idea if thats what you thought too!
Sorry for the late response, kind of dropped the ball.