adopted-ember-addons / ember-cp-validations

Ember computed property based validations

Home Page:https://adopted-ember-addons.github.io/ember-cp-validations/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any desire for an acceptance validator?

justinzelinsky opened this issue · comments

I've finished migrating my companies project to ember-cp-validations and it's been an absolute pleasure! We were using ember-validations before and one of the shipped validators was acceptance which essentially checked if a value was equal to 1, "1", or true (or a custom acceptance value). Is there any desire to port this validator to become part of the shipped validators or is there a preferable way to implement this with the shipped validators here?

You should be able to just use the inclusion validator:

validator('inclusion', {
  in: [1, '1', true]
})

Oh interesting! Presumably we could use a computed value for in as long as it returns an array?