title: ember-data find using a model fetched using other find's result
body: <p>I am using this settup:</p>
  
  <pre><code>Ember      : 1.10.0
  Ember Data : 1.0.0-beta.16
  jQuery     : 1.11.2
  ember-localstorage-adapter: 0.5.2
  </code></pre>
  
  <p>I managed to use the ember-cli to store some data in my datastore (Localstorage)</p>
  
  <p>Now, I would like to retrieve the data. I have 3 classes in my model:</p>
  
  <pre><code>mtg-item.js
    name: DS.attr('string'),
    material: DS.attr('string'),
    description: DS.attr('string')
  
  mtg-point.js
    long: DS.attr('string'),
    lat: DS.attr('string')
  
  mtg-item-at-point.js
    item: DS.belongsTo('mtgItem', {inverse: null}),
    position: DS.belongsTo('mtgPoint', {inverse: null})
  </code></pre>
  
  <p>Here are the data in localstorage:</p>
  
  <pre><code>mantrailling-item: "{"mtgItem":{"records":{"an0jf":{"id":"an0jf","name":"chaussette","material":"tissu","description":"carré de tissus"}}}}"
  mantrailling-item-at-point: "{"mtgItemAtPoint":{"records":{"r7v07":{"id":"r7v07","item":"an0jf","position":"qqnpa"}}}}"
  mantrailling-point: "{"mtgPoint":{"records":{"qqnpa":{"id":"qqnpa","long":"0","lat":"0"}}}}"mantrailling-style: "{"mtgStyle":{"records":{"rggrm":{"id":"rggrm","name":"default","path":null}}}}"__proto__: Storage
  </code></pre>
  
  <p>when I try to retrieve the data, I have no problem retrieving the mtgItem and the mtgPoint.
  The issue is when trying to retrieve the mtgItemAtPoint.
  I get an assert error:</p>
  
  <blockquote>
    <p>Error: Assertion Failed: You cannot add a 'undefined' record to the
    'mtgItemAtPoint.item'. You can only add a 'mtgItem' record to this
    relationship.</p>
  </blockquote>
  
  <p>When debugging, I observed that it occured when trying to set the mtgItem.
  I narrowed the search in the belongs-to.js file line 70.</p>
  
  <pre><code>  var type = this.relationshipMeta.type;
    Ember.assert("You cannot add a '" + newRecord.constructor.typeKey + "' record to the '" + this.record.constructor.typeKey + "." + this.key +"'. " + "You can only add a '" + type.typeKey + "' record to this relationship.", (function () {
      if (type.__isMixin) {
        return type.__mixin.detect(newRecord);
      }
      if (Ember.MODEL_FACTORY_INJECTIONS) {
        type = type.superclass;
      }
      return newRecord instanceof type;
    })());
  </code></pre>
  
  <p>The assertion is trying to check if the newRecord is of extends the supertype DS.Model.</p>
  
  <p>When I retrieve the values in debug, here is what I get for type and newRecord:</p>
  
  <pre><code>newRecord.type.__super__.constructor
  (subclass of DS.Model)
  
  type
  (subclass of DS.Model)
  </code></pre>
  
  <p>So I don't get why the folowing: </p>
  
  <pre><code>return newRecord instanceof type
  </code></pre>
  
  <p>returns false?</p>
  
  <p>For the record, I am calling the find like this:</p>
  
  <pre><code>var mtgItem = store.find('mtgItem', {name: "chaussette", material: "tissu"});
  mtgItem.then(function(mtgItem) {
      var mtgPoint = store.find('mtgPoint', {long: "0", lat: "0"});
      mtgPoint.then(function(mtgPoint) {
          var mtgItemAtPoint = store.find('mtgItemAtPoint', {item: mtgItem, position: mtgPoint});
      });
  });
  </code></pre>