Created
August 11, 2009 15:41
-
-
Save thomaslang/165911 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* 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