Created
May 9, 2017 12:25
-
-
Save jlami/8d2daa7a3509e00f59be3c3d6e2f3bff to your computer and use it in GitHub Desktop.
unloadRecord-breaks-2.13
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
| import Ember from "ember"; | |
| import DS from "ember-data"; | |
| const {attr, belongsTo} = DS; | |
| export default DS.Model.extend({ | |
| author: belongsTo('author'), | |
| name: attr('string'), | |
| }); |
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
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| post2: null, | |
| model() { | |
| let author = this.store.createRecord('author', {name: 'Author'}); | |
| let post1 = this.store.createRecord('post', {name: 'Post 1', author: author}); | |
| this.post2 = this.store.createRecord('post', {name: 'Post 2', author: author}); | |
| return author; | |
| }, | |
| actions: { | |
| test() { | |
| this.post2.unloadRecord(); | |
| }, | |
| }, | |
| }); |
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
| { | |
| "version": "0.12.1", | |
| "EmberENV": { | |
| "FEATURES": {} | |
| }, | |
| "options": { | |
| "use_pods": false, | |
| "enable-testing": false | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
| "ember": "2.12.0", | |
| "ember-template-compiler": "2.12.0", | |
| "ember-testing": "2.12.0" | |
| }, | |
| "addons": { | |
| "ember-data": "2.12.1" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment