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 | |
// $ npm install model@0.2.10 | |
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 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 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 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', |