Skip to content

Commit

Permalink
improve variable names (these are actually InternalModel’s)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Sep 3, 2015
1 parent 0b881fd commit d822eca
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/ember-data/lib/system/record-array-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export default Ember.Object.extend({
Ember.run.schedule('actions', this, this.updateRecordArrays);
},

recordArraysForRecord: function(record) {
record._recordArrays = record._recordArrays || OrderedSet.create();
return record._recordArrays;
recordArraysForRecord: function(internalModel) {
internalModel._recordArrays = internalModel._recordArrays || OrderedSet.create();
return internalModel._recordArrays;
},

/**
Expand All @@ -69,41 +69,41 @@ export default Ember.Object.extend({
this.changedRecords.length = 0;
},

_recordWasDeleted: function (record) {
var recordArrays = record._recordArrays;
_recordWasDeleted: function (internalModel) {
var recordArrays = internalModel._recordArrays;

if (!recordArrays) { return; }

recordArrays.forEach((array) => array.removeInternalModel(record));
recordArrays.forEach((array) => array.removeInternalModel(internalModel));

record._recordArrays = null;
internalModel._recordArrays.length = 0;
},


_recordWasChanged: function (record) {
var typeClass = record.type;
_recordWasChanged: function (internalModel) {
var typeClass = internalModel.type;
var recordArrays = this.filteredRecordArrays.get(typeClass);
var filter;
recordArrays.forEach((array) => {
filter = get(array, 'filterFunction');
this.updateFilterRecordArray(array, filter, typeClass, record);
this.updateFilterRecordArray(array, filter, typeClass, internalModel);
});
},

//Need to update live arrays on loading
recordWasLoaded: function(record) {
var typeClass = record.type;
recordWasLoaded: function(internalModel) {
var typeClass = internalModel.type;
var recordArrays = this.filteredRecordArrays.get(typeClass);
var filter;

recordArrays.forEach((array) => {
filter = get(array, 'filterFunction');
this.updateFilterRecordArray(array, filter, typeClass, record);
this.updateFilterRecordArray(array, filter, typeClass, internalModel);
});

if (this.liveRecordArrays.has(typeClass)) {
var liveRecordArray = this.liveRecordArrays.get(typeClass);
this._addRecordToRecordArray(liveRecordArray, record);
this._addRecordToRecordArray(liveRecordArray, internalModel);
}
},
/**
Expand Down

0 comments on commit d822eca

Please sign in to comment.