Skip to content

Instantly share code, notes, and snippets.

@skizzybiz
Created May 18, 2011 16:42
Show Gist options
  • Save skizzybiz/978967 to your computer and use it in GitHub Desktop.
Save skizzybiz/978967 to your computer and use it in GitHub Desktop.
Model schema
sc_require('models/base_model');
Authoring.Nomination = Authoring.BaseWithTimestamps.extend({
// ...
reportTemplate: SC.Record.toOne('Authoring.ReportTemplate', {
isMaster: NO,
key: "report_template_id",
inverse: "nominations"
}),
// ...
});
sc_require('models/base_model');
Authoring.ReportTemplate = Authoring.BaseWithTimestamps.extend({
name: SC.Record.attr(String),
// more columns...
nominations: SC.Record.toMany('Authoring.Nomination', {
isMaster: YES
}),
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment