Is there a way to override the attribute installer in Ember Data 1.0.0? I would like to clear the data before any events are fired or updated properties are updated.
I am currently using the following method, but I do not like it, because I should always remember to use dirtyPositionwhen setting a new value:
SampleApp.Line = DS.Model.extend({
position: DS.attr("number"),
dirtyPosition: function(key, value) {
this.set("position", Math.max(0, value));
}
});
It would be much better if I somehow redefined the property position... But I cannot find a way to do this.
source
share