-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUGFIX release] Fix Model.modelName
inheritance with Ember 3.2+.
#5406
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for helping track this down!
Changing the check to the below will fix the tests for pre ember canary: if (!klass.modelName || !klass.hasOwnProperty('modelName')) {
klass.modelName = modelName;
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to add a check for missing modelName unfortunately.
On Ember 3.2 and higher, Ember uses "real" inheritance when an `Ember.Object` is `.extend()`ed. This means that in 3.2 and higher the `ModelClassHere.modelName` property is now being inherited (where previously each `.extend()` reset the value to `null`). The fix here ensures that each `ModelClass.extend()` gets its own `modelName`...
This test was attempting to ensure that the records guid was included in the `record.toString()` output, but changes in Ember 3.2+ changed the default output of the class / constructor name portion (therefore failing the assertion in a useless way). This updates the test to add a custom `toString` to the model class so that we can be decoupled from how Ember `.toString()`'s classes when there is no custom `.toString` setup (because this is actually fairly unstable version over version).
89f9dd4
to
342de27
Compare
* [BUGFIX release] Fix `Model.modelName` inheritance with Ember 3.2+. On Ember 3.2 and higher, Ember uses "real" inheritance when an `Ember.Object` is `.extend()`ed. This means that in 3.2 and higher the `ModelClassHere.modelName` property is now being inherited (where previously each `.extend()` reset the value to `null`). The fix here ensures that each `ModelClass.extend()` gets its own `modelName`... * [BUGFIX release] Fix toString test to work with Ember 3.2+. This test was attempting to ensure that the records guid was included in the `record.toString()` output, but changes in Ember 3.2+ changed the default output of the class / constructor name portion (therefore failing the assertion in a useless way). This updates the test to add a custom `toString` to the model class so that we can be decoupled from how Ember `.toString()`'s classes when there is no custom `.toString` setup (because this is actually fairly unstable version over version). * fix branch
* [BUGFIX release] Fix `Model.modelName` inheritance with Ember 3.2+. On Ember 3.2 and higher, Ember uses "real" inheritance when an `Ember.Object` is `.extend()`ed. This means that in 3.2 and higher the `ModelClassHere.modelName` property is now being inherited (where previously each `.extend()` reset the value to `null`). The fix here ensures that each `ModelClass.extend()` gets its own `modelName`... * [BUGFIX release] Fix toString test to work with Ember 3.2+. This test was attempting to ensure that the records guid was included in the `record.toString()` output, but changes in Ember 3.2+ changed the default output of the class / constructor name portion (therefore failing the assertion in a useless way). This updates the test to add a custom `toString` to the model class so that we can be decoupled from how Ember `.toString()`'s classes when there is no custom `.toString` setup (because this is actually fairly unstable version over version). * fix branch
* [BUGFIX release] Fix `Model.modelName` inheritance with Ember 3.2+. On Ember 3.2 and higher, Ember uses "real" inheritance when an `Ember.Object` is `.extend()`ed. This means that in 3.2 and higher the `ModelClassHere.modelName` property is now being inherited (where previously each `.extend()` reset the value to `null`). The fix here ensures that each `ModelClass.extend()` gets its own `modelName`... * [BUGFIX release] Fix toString test to work with Ember 3.2+. This test was attempting to ensure that the records guid was included in the `record.toString()` output, but changes in Ember 3.2+ changed the default output of the class / constructor name portion (therefore failing the assertion in a useless way). This updates the test to add a custom `toString` to the model class so that we can be decoupled from how Ember `.toString()`'s classes when there is no custom `.toString` setup (because this is actually fairly unstable version over version). * fix branch
On Ember 3.2 and higher, Ember uses "real" inheritance when an
Ember.Object
is.extend()
ed. This means that in 3.2 and higher theModelClassHere.modelName
property is now being inherited (where previously each.extend()
reset the value tonull
).The fix here ensures that each
ModelClass.extend()
gets its ownmodelName
...