adopted-ember-addons / adopted-ember-addons/ember-cp-validations
validation depending on status of other field
Open
- Dominant language
- JavaScript
- Stars
- 439
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
### Environment
- Ember Version: 2.8.1
- Ember CP Validations Version: 3.0.1
### Steps to Reproduce
I'm trying to validate a dropdown value only if a checkbox is selected. How would I do this:
Model:
export default DS.Model.extend(Validations, {
age_restriction: DS.attr('number', {defaultValue: 0}),
isAgeRestricted: Ember.computed.gt('age_restriction', 0),
});
isAgeRestricted will return a boolean value. I need to validate the age_restriction is greater than zero only if isAgeRestricted is true.
Contributor guide
Assessment
This issue has not been assessed yet.