emberjs / data

A lightweight reactive data library for web applications. Designed over composable primitives.
https://api.emberjs.com/ember-data/release
Other
3.03k stars 1.33k forks source link

store.filter() raw datahash, data._savedData or data.savedData? #336

Closed ralfschimmel closed 12 years ago

ralfschimmel commented 12 years ago

Currently this is needed in the filter method of the store:

var filteredData = this.get('store').filter(PC.Ticket, function(data) {
    var rawHash = null;
if (data.hasOwnProperty('_savedData')) {
    rawHash = data._savedData;
} else if (data.hasOwnProperty('savedData')) {
    rawHash = data.savedData;
}
    .... use rawHash to filter .....
}

How come the datahash property has different names?

tchak commented 12 years ago

You should not do this. You using private api... Any way, filter was modified on the relationships rework branch, so in the future it will materialize records

ralfschimmel commented 12 years ago

store.filter is private api?

I agree that using _savedData is private api, but what are my options here?

tchak commented 12 years ago

store.filter is not private :) _savedData / savedDate are private you should use data.get(key) and when the new branch is merged, data is going to be the record

ralfschimmel commented 12 years ago

Ok tnx, any idea when the new branch will get merged?

tchak commented 12 years ago

nop, but as far as I can tell it is in a good shape, so I hope pretty soon