-
-
Save AmilKey/cbb56c5418a67edc25d419f1a3722591 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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