ValidationRules ensureObject().satisfies() not working


#1

Hi,

I’ve just started to try using .ensureObject when validating objects. I rarely have the need, but very occasionally I want to do this:

ValidationRules
  .ensure(a => a.firstName).required()
  .ensure(a => a.lastName).required()
  .ensure(a => a.email).required().email()
  .ensureObject().satisfies(a => {
    return /* some complex condition of the object */;
  })
  .on(...);

I understand that the rule won’t get called on any property change, because ensureObject is not tied to a particular property. But I cannot get the rule to be called ever. this.controller.validate() should run all rules (including ensureObject rules), but it doesn’t.

I’ve created a gist here showing the problem. Enter all form fields and click submit. The form should fail (because ensureObject().satisfies() always returns false) and yet validation passes.

Any ideas? Thanks!