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
| var | |
| // $ npm install [email protected] | |
| model = require( 'model'), | |
| Adapter = require('./node_modules/model/lib/adapters/memory/').Adapter, | |
| adapter = new Adapter({}); | |
| var User = function () { | |
| this.adapter = adapter; | |
| this.property('login', 'string', {required: true}); | |
| this.property('password', 'string', {required: true}); |
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
| var User = function () { | |
| this.hasMany('Messages'); | |
| this.hasMany('ConversationMemberships'); | |
| this.hasMany('Conversations', {through: 'ConversationMembership'}); | |
| }; | |
| var Conversation = function () { | |
| this.hasMany('Messages'); | |
| this.hasMany('ConversationMemberships'); | |
| this.hasMany('Users', {through: 'ConversationMembership'}); |
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
| var Item = function () { | |
| this.defineProperties({ | |
| name: {type: 'string'} | |
| }); | |
| this.findByName = function (name, callback) { | |
| geddy.model.Item.all({name: name}, callback); | |
| } | |
| } |
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
| var spawn = require('child_process').spawn; | |
| desc('Do thing 1'); | |
| task('thing1', [], function () { | |
| var cmds = ['node -e "console.log(\'--> Thing 1... Executing\')"']; | |
| console.log('--> Thing 1... Starting'); | |
| jake.exec(cmds, function () { | |
| var echo = spawn('echo', |