jasonmit / ember-i18n-cp-validations

ember-i18n support for ember-cp-validations
MIT License
21 stars 16 forks source link

Use reopenClass for static properties. #7

Closed blimmer closed 8 years ago

blimmer commented 8 years ago

This caused a subtle bug in unit/integration testing where the i18n injection could lose its container during test runtime. Per the guides, static properties should be defined in a reopenClass, while shared instance methods & properties should be defined in a reopen. Fixes #5.

jasonmit commented 8 years ago

This doesn't access an instance of the type, or attempt to create instances of the type, this extends the type. So I don't believe an instance-initializer is needed here and the assertion failure is due to something else -- but I'm unsure what that something is. Can you put together a little dummy app so I can step through this to fully understand the problem.

Thanks again for taking the time to help resolve it

blimmer commented 8 years ago

NVM on this. The issue was that in my unit test, I needed to

needs: ['validator:messages']

so the container had it.

Sorry for the noise.

jasonmit commented 8 years ago

:+1: thanks for circling back, I'm sure it will help future travelers. Might be useful in the docs on ember-cp-validations