Skip to content

Instantly share code, notes, and snippets.

@cloke
Created February 4, 2013 23:29
Show Gist options
  • Save cloke/4710719 to your computer and use it in GitHub Desktop.
Save cloke/4710719 to your computer and use it in GitHub Desktop.
{ [ { id: "32111aae", spot_number: "BAH", commercials: [{ id: "33321eaz", title: "yar"}] } ] }
Binder.Spot = DS.Model.extend({
spot_number: DS.attr('string')
});
Binder.Commercial = DS.Model.extend({
title: DS.attr('string'),
spot: DS.belongsTo(Binder.Spot)
});
Binder.Spot.reopen({
commercials: DS.hasMany(Binder.Commercial)
});
DS.RESTAdapter.map(Binder.Commercial({
spot: {
embedded: 'always'
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment