title: Ember - Updating ember record with new ID on PUT request
body: <p>I have a backend that will create a new resource on a <code>PUT</code> request if the requested resource is not found. I.E... </p>
  
  <ol>
  <li><p>Make a <code>PUT</code> request to <code>/api/v1/person/1/</code></p></li>
  <li><p>For one reason or another person with id 1 has been deleted from server</p></li>
  <li><p>Server creates new person record with id 2</p></li>
  </ol>
  
  <p>Now in my case these requests are being triggered from an Ember app. When I try to update a person in the Ember store with id 1 and it is deleted on the server, I get - <code>An adapter cannot assign a new id to a record that already has an id.</code></p>
  
  <p>The server has returned a new person record with id 2 and Ember errors trying to apply it to the model it has in it's store with id of 1.</p>
  
  <p>So far I am overriding the <code>updateId</code> method of <code>DS.Store</code>:</p>
  
  <pre><code>export default DS.Store.extend({
    updateId: function(record, data) {
      var oldId = Ember.get(record, 'id');
      var id = coerceId(data.id);
  
      if (oldId &amp;&amp; oldId !== id) {
        this.typeMapFor(record.constructor).idToRecord[oldId] = record;
      } else {
        this.typeMapFor(record.constructor).idToRecord[id] = record;
      }
  
      Ember.set(record, 'id', id);
    },
  };
  </code></pre>
  
  <p>But this just feels wrong. Are there any negative consequences to this override? Or is there any other way to work around this?</p>