[ember-source 3.13] using a computed property in the `before` key for a validator throws error
efx opened this issue · comments
Environment
- Ember Version: 3.13
- Ember CLI Version: ~3.12.0
- Ember CP Validations Version: 4.0.0-beta.9
Steps to Reproduce
- clone the following repository and run
yarn test
: https://github.com/efx/cp-validations-test
Specifically using the alias
computed within a validation object breaks with ember-source. The ember-source assertion is in core_object.js.
The failing logic occurs in
https://github.com/offirgolan/ember-cp-validations/blob/2e901724390172d3b9584aec69696e2f8e28fc29/addon/-private/options.js#L26
If you pause execution it seems to happen since options.before
is a COMPUTED_DECORATOR
?
@patocallaghan thank you for pointing that out and fixing the issue! I'll test that PR in our application today.
Looks like @GavinJoyce has also started to fix for 3.13 in #662
Just ran into this and it seems it also occurs when the validation rule includes the disabled
option. At least, when I remove that, the error no longer occurs.
Verified that https://github.com/offirgolan/ember-cp-validations/tree/v4.0.0-beta.10 fixes this issue. Probably via #668