offirgolan / ember-changeset-cp-validations

Ember CP Validations support for Ember Changeset
MIT License
17 stars 10 forks source link

Validation doesn't work on a validator with dependentKeys #26

Open aonawale opened 7 years ago

aonawale commented 7 years ago

I noticed that validators with dependent keys don't work as expected. The value is also invalid even when it is really valid.

export default buildValidations({
  paymentMethod: validator('inclusion', { in: ['cash', 'card'] }),
  creditCard: validator('presence', {
    presence: true,
    dependentKeys: ['model.paymentMethod'],
    disabled: computed.equal('model.paymentMethod', 'cash')
  })
});

Is there a fix or workaround for this?