DEBUG: -------------------------------
DEBUG: Ember : 1.2.0
DEBUG: Ember Data : 1.0.0-beta.2
DEBUG: Handlebars : 1.1.2
DEBUG: jQuery : 1.10.2
DEBUG: -------------------------------
Last active
August 29, 2015 13:55
-
-
Save rauhryan/8735491 to your computer and use it in GitHub Desktop.
Ember data side loading
This file contains 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
Ember.Inflector.inflector.irregular "delta", "deltas" | |
Ember.Inflector.inflector.singular /delta/, "delta" | |
App.DeltaStream = DS.Model.extend | |
name: DS.attr 'string' | |
cursor: DS.attr 'number' | |
deltas: DS.hasMany 'delta' | |
checkpoint: DS.attr() | |
App.Delta = DS.Model.extend | |
idx: DS.attr 'number' | |
delta: DS.attr 'string' | |
App.store.find("deltaStream", "41471f04-89cc-11e3-9617-8608f94f752c").then (stream) -> | |
stream.get("deltas") #=> always empty :( |
This file contains 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
{ | |
"delta_stream": { | |
"cursor": 14, | |
"deltas": [ | |
25 | |
], | |
"id": "41471f04-89cc-11e3-9617-8608f94f752c" | |
}, | |
"deltas": [ | |
{ | |
"delta": "{\"nodes.47f1a536-89cc-11e3-95b1-84d9f8cf6fc0\":{\"position\":{\"x\":25.556085920887575,\"y\":-491.86849128278345}}}", | |
"id": 25, | |
"idx": 0 | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment