# Belongs\_to Data Goes Null While Saving

**URL:** <https://discuss.emberjs.com/t/belongs-to-data-goes-null-while-saving/12148>\
**Category:** Uncategorized\
**Created:** [December 24, 2016, 9:33am UTC](https://discuss.emberjs.com/t/belongs-to-data-goes-null-while-saving/12148 "2016-12-24T09:33:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harun\_Tuncay](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/harun_tuncay/32/16888_2.png) [@Harun\_Tuncay](https://discuss.emberjs.com/u/Harun_Tuncay)\
**Post date:** [December 24, 2016, 9:33am UTC](https://discuss.emberjs.com/t/belongs-to-data-goes-null-while-saving/12148/1 "2016-12-24T09:33:45Z")

</div>

Hi everyone.I am building a toy app and wanted to work with a simple 1:many relationship. My car model “hasMany comments” & my comments “belongsTo car”.I want a comment to be created from cars/car route.So i didn’t created a route for comments/new.For a quick trial i have added a button that has “saveComment” action.

```
<button type="submit" {{action 'saveComment' model}}>Submit</button>

```

!!! I am passing the model because in my action i want to read it’s id and set it to comments car\_id.

And here is the correspanding route file

```
  model(params){
   return this.store.findRecord('car', params.car_id);
  },
 actions: {
  saveComment(model){
     let car = this.store.peekRecord('car', model.id),
     let newComment = this.store.createRecord('comment'{
            car: car,
            body: 'Some filler text! ',
        });
   car.get('comments').pushObject('newComment');
   newComment.save();
  }

```

The problem is, my (let the route be cars/10) current template includes the newly generated comment with the proper body, however when i inspect it, belongsTo relationship looks empty.Since car\_id goes null, after a reload, new generated comments disappeares.(not from the database tho, it is saved succesfully without a car relationship).What should i do to get this comments.car saved? TIA
