Created
March 3, 2010 20:45
-
-
Save gaustin/320990 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [] } | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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