Skip to content

Instantly share code, notes, and snippets.

@gaustin
Created March 3, 2010 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaustin/320990 to your computer and use it in GitHub Desktop.
Save gaustin/320990 to your computer and use it in GitHub Desktop.
sc_require('models/item');
McAdmin.Item.FIXTURES = [
{ href: "/",
name: "Inventory",
guid: "SOMEGUID0",
mimetype: "application/x-folder",
version: 1,
properties: [],
relationships: [],
children: [
'SOMEGUID1',
'SOMEGUID2',
'SOMEGUID3'
],
parent: []},
{ href: "/Ops",
name: "Ops",
guid: "SOMEGUID1",
mimetype: "application/x-folder",
version: 1,
properties: [],
relationships: [],
parent: ['SOMEGUID0'],
children: [
'SOMEGUID2',
'SOMEGUID3'
] },
{ href: "/Ops/Net",
name: "Net",
guid: "SOMEGUID2",
mimetype: "application/x-folder",
version: 1,
properties: [],
relationships: [],
parent: ['SOMEGUID1'],
children: [] },
{ href: "/Ops/Host",
name: "Host",
guid: "SOMEGUID3",
mimetype: "application/x-folder",
version: 1,
properties: [],
relationships: [],
parent: ['SOMEGUID1'],
children: [] },
{ href: "/Sys",
name: "Sys",
guid: "SOMEGUID4",
mimetype: "application/x-folder",
version: 1,
properties: [],
relationships: [],
parent: ['SOMEGUID0'],
children: [] },
{ href: "/Client",
name: "Client",
guid: "SOMEGUID5",
mimetype: "application/x-folder",
version: 1,
properties: [],
relationships: [],
parent: ['SOMEGUID0'],
children: [] }
];
McAdmin.Item = SC.Record.extend(
/** @scope McAdmin.Item.prototype */ {
// TODO: Add your own code here.
href: SC.Record.attr(String),
name: SC.Record.attr(String),
guid: SC.Record.attr(String),
mimetype: SC.Record.attr(String),
version: SC.Record.attr(Number),
properties: SC.Record.attr(Array),
relationships: SC.Record.attr(Array),
primaryKey: "href",
children: SC.Record.toMany('McAdmin.Item', {inverse: "parent", isMaster: YES }),
parent: SC.Record.toOne('McAdmin.Item', {inverse: "children", isMaster: NO })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment