I was perusing the code for Ext.data.Model and saw something that struck me as odd - perhaps incorrect. The implementation for setDirty iterates over all defined fields and sets them as modified. It does so by:
Code:
me.fields.each(function(field) {
    if (field.persist) {
        name = field.name;
        me.modified[name] = me.get(name);
    }
}, me);
The problem with this is that if reject() is ever called, there is no way to undo the effects.
I think it would be more correct to preserve "modified" if possible, as such:
Code:
me.fields.each(function(field) {
    if (field.persist) {
        name = field.name;
        if(!me.modified.hasOwnProperty(name)){
            me.modified[name] = me.get(name);
        }
    }
}, me);
thoughts?