Created
May 29, 2011 02:45
-
-
Save tritchey/997424 to your computer and use it in GitHub Desktop.
fixture issue
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
... | |
var _dnsConfigs = ScaleModel.getDNSConfigs(); | |
ScaleUI.dnsConfigsController.set('content', _dnsConfigs); | |
... |
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
ScaleUI.dnsConfigsController = SC.ArrayController.create({ | |
statusChanged: function() { | |
var status = this.get('status'); | |
if(status & SC.Record.READY) { | |
ScaleUI.dnsConfigController.set('content', this.get('firstObject')); | |
} | |
}.observes('*content.status'), | |
}); | |
ScaleUI.dnsConfigController = SC.ObjectController.create({ | |
contentBinding: 'ScaleUI.dnsConfigsController*content.firstObject' | |
}); | |
ScaleUI.dnsServersController = SC.ArrayController.create({ | |
contentBinding: 'ScaleUI.dnsConfigController*content.dnsServers' | |
}); | |
ScaleUI.searchDomainsController = SC.ArrayController.create({ | |
contentBinding: 'ScaleUI.dnsConfigController*content.searchDomains' | |
}); |
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/dns'); | |
ScaleModel.DNSServer.FIXTURES = [ | |
{ | |
guid: 1, | |
ipAddress: "10.0.0.15" | |
}, | |
{ | |
guid: 2, | |
ipAddress: "10.0.1.2" | |
} | |
]; | |
ScaleModel.DNSSearchDomain.FIXTURES = [ | |
{ | |
guid: 1, | |
name: "indy.scalecomputing.com" | |
}, | |
{ | |
guid: 2, | |
name: "sm.scalecomputing.com" | |
}, | |
{ | |
guid: 3, | |
name: "scalecomputing.com" | |
} | |
]; | |
ScaleModel.DNSConfig.FIXTURES = [ | |
{ | |
dnsConfigGUID: 1, | |
dnsServers: [ 1, 2 ], | |
searchDomains: [ 1, 2, 3 ], | |
cluster: 1 | |
} | |
]; |
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
ScaleModel.DNSServer = SC.Record.extend( | |
/** @scope ScaleModel.DNSServer.prototype */ { | |
ipAddress: SC.Record.attr(String), | |
}) ; | |
ScaleModel.DNSSearchDomain = SC.Record.extend( | |
/** @scope ScaleModel.DNSSearchDomain.prototype */ { | |
name: SC.Record.attr(String), | |
}) ; | |
ScaleModel.DNSConfig = SC.Record.extend( | |
/** @scope ScaleModel.DNSConfig.prototype */ { | |
primaryKey: 'dnsConfigGUID', | |
dnsServers: SC.Record.toMany("ScaleModel.DNSServer", { | |
isMaster: NO | |
}), | |
searchDomains: SC.Record.toMany("ScaleModel.DNSSearchDomain", { | |
isMaster: NO | |
}), | |
cluster: SC.Record.toOne("ScaleModel.Cluster", { | |
inverse: "dns", isMaster: NO | |
}) | |
}) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment