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

Broken with Ember 3.13

jherdman opened this issue · comments

Environment

  • Ember Version: 3.13
  • Ember CLI Version: 3.13
  • Ember CP Validations Version: 4.0.0b9

Steps to Reproduce

Error: Assertion Failed: EmberObject.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().

Pointing to https://github.com/offirgolan/ember-cp-validations/blob/2e901724390172d3b9584aec69696e2f8e28fc29/addon/-private/options.js#L26

None of my validations are particularly interesting. Here's an example on the more interesting side of things:

const validations = buildValidations({
  value: [
    validator('presence', true),

    validator('inline', {
      validate(value, _, model) {
      let choices = model.get('choices');

      return value && value.every(elem => { return choices.includes(elem); });
      },
    }),
  ],
}, {
  disabled: not('model.required'),

  message: readOnly('model.validationText'),
});
commented

this likely might be a duplicate of #661 - one of the properties that seems to cause trouble is disabled

Should be resolved by #662.