From 551e39a1ced36a3633969406f970f930cc641a36 Mon Sep 17 00:00:00 2001 From: Esteban Arango Medina Date: Tue, 28 Mar 2017 12:01:12 -0700 Subject: [PATCH] [BUGFIX beta] Removes `get record` from InternalModel. (#4901) * [BUGFIX beta] Removes `get record` from InternalModel. Prefer `getRecord `. Fixes #4756 * Node version for tests. * `getRecord` instead of `_record` on `RecordReference.prototype.value`. --- addon/-private/system/model/internal-model.js | 42 +++++++++---------- addon/-private/system/references/record.js | 4 +- .../system/relationships/state/belongs-to.js | 2 +- tests/unit/store/adapter-interop-test.js | 2 +- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/addon/-private/system/model/internal-model.js b/addon/-private/system/model/internal-model.js index bc3eb539422..485acc5b4b1 100644 --- a/addon/-private/system/model/internal-model.js +++ b/addon/-private/system/model/internal-model.js @@ -60,7 +60,7 @@ function extractPivotName(name) { function areAllModelsUnloaded(internalModels) { for (let i=0; i 0) { - this.record._notifyProperties(dirtyKeys); + this._record._notifyProperties(dirtyKeys); } } @@ -818,7 +814,7 @@ export default class InternalModel { this.currentState = state; if (this.hasRecord) { - set(this.record, 'currentState', state); + set(this._record, 'currentState', state); } for (i = 0, l = setups.length; i < l; i++) { @@ -857,7 +853,7 @@ export default class InternalModel { return; } let triggers = this._deferredTriggers; - let record = this.record; + let record = this._record; let trigger = record.trigger; for (let i = 0, l= triggers.length; i { return store._scheduleFetchMany(internalModels).then(() => { - let unloadedRecords = Ember.A(internalModels.map(r => r.record)).filterBy('isEmpty'); + let unloadedRecords = Ember.A(internalModels.map(r => r.getRecord())).filterBy('isEmpty'); assert.equal(get(unloadedRecords, 'length'), 0, 'All unloaded records should be loaded'); });