Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ember-source 3.13] using a computed property in the before key for a validator throws error #661

Closed
ghost opened this issue Sep 20, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 20, 2019

Environment

  • Ember Version: 3.13
  • Ember CLI Version: ~3.12.0
  • Ember CP Validations Version: 4.0.0-beta.9

Steps to Reproduce

  1. 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?
Screen Shot 2019-09-20 at 14 07 39

@ghost ghost mentioned this issue Sep 20, 2019
@patocallaghan
Copy link

@efx I believe this currently open PR will fix the issue #653

@ghost
Copy link
Author

ghost commented Sep 23, 2019

@patocallaghan thank you for pointing that out and fixing the issue! I'll test that PR in our application today.

@ghost
Copy link
Author

ghost commented Sep 23, 2019

Looks like @GavinJoyce has also started to fix for 3.13 in #662

@st-h
Copy link
Contributor

st-h commented Oct 4, 2019

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.

@ghost
Copy link
Author

ghost commented Jan 24, 2020

Verified that https://github.com/offirgolan/ember-cp-validations/tree/v4.0.0-beta.10 fixes this issue. Probably via #668

@ghost ghost closed this as completed Jan 24, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants