Skip to content

Commit

Permalink
[BUGFIX canary] eliminate recordData prop restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Mar 24, 2019
1 parent aed597c commit 739f78e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
10 changes: 0 additions & 10 deletions addon/-private/system/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,16 +1213,6 @@ if (DEBUG) {
);
}

if (
!isDefaultEmptyDescriptor(this, 'recordData') ||
this.recordData !== undefined ||
this.recordData !== this._internalModel.recordData
) {
throw new Error(
`'recordData' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`
);
}

if (
!isDefaultEmptyDescriptor(this, 'currentState') ||
this.get('currentState') !== this._internalModel.currentState
Expand Down
9 changes: 1 addition & 8 deletions tests/unit/model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,6 @@ module('unit/model - Model', function(hooks) {
@attr('string')
name;
}
class NativePostWithRecordData extends Model {
@attr('string', { defaultValue: 'hello' })
recordData;
@attr('string')
name;
}
class NativePostWithCurrentState extends Model {
@attr('string')
currentState;
Expand All @@ -690,7 +684,6 @@ module('unit/model - Model', function(hooks) {
}
const PROP_MAP = {
_internalModel: NativePostWithInternalModel,
recordData: NativePostWithRecordData,
currentState: NativePostWithCurrentState,
};
Expand Down Expand Up @@ -730,7 +723,7 @@ module('unit/model - Model', function(hooks) {
});
}
['recordData', '_internalModel', 'currentState'].forEach(testReservedProperty);
['_internalModel', 'currentState'].forEach(testReservedProperty);
testInDebug(
'A subclass of Model throws an error when calling create() directly',
Expand Down

0 comments on commit 739f78e

Please sign in to comment.