title: ExtJS 6 : load nested data by creating new instance of model
body: <p>I try to create a model with an hasMany association but when I try to access to the store, it's empty.</p>
  
  <p>This is my models : </p>
  
  <p>BaseModel : </p>
  
  <pre><code>Ext.define( 'Test.model.schema.BaseModel', {
      extend: 'Ext.data.Model',
  
      schema: {
          namespace: 'Test.model'
      }
  } );
  </code></pre>
  
  <p>UserModel : </p>
  
  <pre><code>Ext.define('Test.model.user.UserModel', {
      extend: 'Ext.data.Model',
  
      fields: [
          {
              name: 'displayName',
              type: 'string'
          }
      ],
  
      hasMany: [
          {
              name: 'roles',
              model: 'user.RoleModel', // also try with Test.model.user.RoleModel
              associationKey: 'roles'
          }
      ]
  });
  </code></pre>
  
  <p>RoleModel : </p>
  
  <pre><code>Ext.define('Test.model.user.RoleModel', {
      extend: 'Ext.data.Model',
  
      fields: [
          {
              name: 'label',
              type: 'string'
          }
      ]
  });
  </code></pre>
  
  <p>This is my Application : </p>
  
  <pre><code>Ext.application({
      name: 'Test',
  
      models : [
          'Test.model.schema.BaseModel',
          'Test.model.user.RoleModel',
          'Test.model.user.UserModel'
      ],
  
      appFolder : contextPath + '/' + staticsPath + '/js/app',
  
      controllers : ['router.TestRouterController'],
  
      defaultToken : 'auth'
  });
  </code></pre>
  
  <p>In my controller I try to create my user model like this : </p>
  
  <pre><code>var user = Ext.create('Test.model.user.UserModel', {
      displayName : 'Mick P.',
      roles : [
          {
              label: 'test'
          }
      ]
  });
  </code></pre>
  
  <p>Same with JSon.</p>
  
  <p>When I do <strong>user.roles().getAt(0)</strong> I got <strong>null</strong> and <strong>user.roles().data.items</strong> is empty.</p>
  
  <p>Do you see what i'm doing wrong ?</p>
  
  <p><strong>EDIT 1 :</strong> A fiddle of my problem : <a href="https://fiddle.sencha.com/#fiddle/1e54" rel="nofollow">https://fiddle.sencha.com/#fiddle/1e54</a></p>
  
  <p><strong>EDIT 2 :</strong> It works if I load my datas with a memory store. But why not by loading directly a model.</p>