Skip to content

@gaustin /item.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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
Something went wrong with that request. Please try again.