code: function updateOrCreate(val) {
          var res = _resources[val._id];
          if (!res) {
            res = new Resource(val, false, new Date().getTime());
          } else {
            res.$updateServer(val);
          }
  
          return res;
        }
docs: updates or creates a model depending on whether we know about it already. This is usually used when we recieve a response with model data from the server using a non-standard method