sdepold/sequelize — pull request #429 by fzaninotto (2013-01-30 10:16:21+00:00)
Title: Add ability to add behavior to a model

How to reuse code across several models? The fact that `classMethods` and `instanceMethods` get attached to the `DAO` during the call to `sequelize.define()` makes it very difficult. This commit allows to reuse methods from an object, as follows:

```js
var myBehavior = function() {
this.foo = true;
}
myBehavior.prototype.bar = function() {
return 'baz';
}

var User = this.sequelize.define('UserWithBehavior', {}, {
behaviors: [MyBehavior]
})

var user = User.build();
user.foo; // true
user.bar(); // 'baz'
```