Created
February 8, 2015 22:42
-
-
Save MiracleBlue/76e2f88138fd1da17a02 to your computer and use it in GitHub Desktop.
Ember Data
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
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
timeline: DS.belongsTo("timeline"), | |
type: DS.attr("string") | |
}); |
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
import DS from 'ember-data'; | |
import Ember from "ember"; | |
var inflector = Ember.Inflector.inflector; | |
inflector.uncountable('timeline'); | |
export default DS.Model.extend({ | |
kitten: DS.belongsTo("kitten"), | |
items: DS.hasMany("timelineItem", {polymorphic: true}) | |
}); |
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
timeline: [ | |
{ | |
id: "meowzah", | |
kitten: "meowzah", | |
items: [ | |
{ | |
id: "whatup", | |
type: "Email", | |
title: "Sup dude", | |
content: "meow mix meow mix please deliver", | |
contentSummary: "meow..." | |
}, | |
{ | |
id: "blah", | |
type: "Note", | |
content: "meow mix meow mix please deliver", | |
contentSummary: "meow..." | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment