indexzero
4/4/2011 - 9:19 PM

identity-cache-issues.js

var User = resourcer.define('User', function () {

});

User.get('some-user', function (err, obj) {

  obj.dont_update_me = 'foo';

  User.update('some-user', { update_this_instead: true }, function () {
    //
    // Both `dont_update_me` and `update_this_instead` will appear in the database 
    // because the cached object is merged with these changes and `obj` is a reference
    // to that object.
    //
  });
});