# How to load deep nested model on parent route?

**URL:** <https://discuss.emberjs.com/t/how-to-load-deep-nested-model-on-parent-route/12006>\
**Category:** Ember Data\
**Created:** [November 28, 2016, 2:57am UTC](https://discuss.emberjs.com/t/how-to-load-deep-nested-model-on-parent-route/12006 "2016-11-28T02:57:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anh\_Pham](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Anh\_Pham](https://discuss.emberjs.com/u/Anh_Pham)\
**Post date:** [November 28, 2016, 2:57am UTC](https://discuss.emberjs.com/t/how-to-load-deep-nested-model-on-parent-route/12006/1 "2016-11-28T02:57:59Z")

</div>

I am having deep nested route like this:

```
 this.route("projects", { path: "/" }, function() {
    this.route('project', { path: ':project_id' }, function() {
         this.route('testcycle', { path: '/testcycle_id' },function(){
           this.route('testsuite', { path: '/:testsuite_id' },function(){
              this.route('testcase',{path: '/:testcase_id'});
          })
       });;
    });
   });

```

And the models: → project

```
export default DS.Model.extend({
    title: DS.attr('string'),
    testcycles: DS.hasMany('testcycle', {
		 async: true
	})
});

```

→ testcycle

```
export default DS.Model.extend({
    name: DS.attr('string'),
    project: DS.belongsTo('project', {
		 async: true
	}),
testsuites: hasMany('testsuite', {
		 async: true
	})
});

```

→ testsuite

```
export default DS.Model.extend({
    name: DS.attr('string'),
    testcycle: DS.belongsTo('testcycle', {
		 async: true
	}),
testcases: hasMany('testcase', {
		 async: true
	}),
});

```

→ testcase

```
export default DS.Model.extend({
    name: DS.attr('string'),
    testsuite: DS.belongsTo('testsuite', {
		 async: true
	})
});

```

the project route is:

```
export default Ember.Route.extend({
    model: function(params) {
        return this.store.findRecord('project', params.project_id);
    },

```

My expectation is displaying the tree (ember-cli-jstree) when user on project/1 page How can I format the json for jstree? I don’t know how to get all children records of testcycles, testsuites, testcases on project page. The data which I am getting now from project page is:

```
{
	"data": {
		"id": "90",
		"type": "projects",
		"attributes": {
			"name": "Grant, Price and Schneider",
			"description": "Cross-platform full-range process improvement"
		},
		"relationships": {
			"testcycles": {
				"data": [{
						"id": "12",
						"type": "testcycles"
					}, {
						"id": "13",
						"type": "testcycles"
					}
				]
			}
		}
	}
}

```

There is no any relating record of testsuites/testcases ☹Please, help me with this,I am very new with Ember! Thanks so much!
