Skip to content

Instantly share code, notes, and snippets.

@shanelau
Created December 4, 2014 02:43
Show Gist options
  • Save shanelau/61cb2fc30d26070b5f48 to your computer and use it in GitHub Desktop.
Save shanelau/61cb2fc30d26070b5f48 to your computer and use it in GitHub Desktop.
ember model fixture data
import DS from 'ember-data';
var Article = DS.Model.extend({
title: DS.attr(),
body: DS.attr(),
comments: DS.hasMany('comment',{async:true})
});
Article.reopenClass({
FIXTURES: [
{id: 1, title: 'Bugs', body: 'djskaljklfjdakljfkldsjklf ',comments:[1,3]},
{id: 2, title: 'Wile E.', body: 'Coyotdsajdksaljdklajskdklasjke',comments:[1]}
]
});
export default Article;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment