Skip to content

Instantly share code, notes, and snippets.

@thomaslang
Created August 11, 2009 15:41
Show Gist options
  • Save thomaslang/165911 to your computer and use it in GitHub Desktop.
Save thomaslang/165911 to your computer and use it in GitHub Desktop.
/* private methods */
_addConcept: function() {
var concept, description;
concept = this.store.createRecord(BB.Concept,
{_id: "@id%@".fmt(SC.Store.generateStoreKey())}
);
concept.set('user', BB.userController);
concept.set('date', new Date());
store.commitRecord(BB.Concept, concept.get('_id'));
concept.addObserver('_id', this, this._addDescription);
//this._addDescription(concept);
return YES;
},
_addDescription: function(concept) {
var store = concept.get('store');
var description;
console.log('_addDescription called');
console.log(concept.get('status'));
if(concept.get('status') == SC.Record.READY_CLEAN) {
console.log('status is READY_CLEAN');
description = store.createRecord(BB.Description,{
content: BB.getPath('addController.description'),
_id: "@id%@".fmt(SC.Store.generateStoreKey())
});
description.set('concept', concept);
description.set('user', BB.userController);
description.set('date', new Date());
store.commitRecord(BB.Description, description.get('_id'));
}
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment