Skip to content

Instantly share code, notes, and snippets.

@AmilKey
Created September 14, 2016 11:30
Show Gist options
  • Save AmilKey/cbb56c5418a67edc25d419f1a3722591 to your computer and use it in GitHub Desktop.
Save AmilKey/cbb56c5418a67edc25d419f1a3722591 to your computer and use it in GitHub Desktop.
save relanships
https://guides.emberjs.com/v2.7.0/models/relationships/
```
let blogPost = this.get('store').peekRecord('blog-post', 1);
let comment = this.get('store').createRecord('comment', {
});
blogPost.get('comments').pushObject(comment);
comment.save().then(function () {
blogPost.save();
});
```
use `inverse: null` for oneHas relationship
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment