balderdashy/waterline — pull request #717 by pierreinglebert (2014-11-05 07:05:02+00:00)
Title: Bind model context to lifecycle callback

I wanted to set a "counter" on my model depending on a criteria.
```javascript
beforeValidate: function(values, cb) {
this.findOne({
where: criteria,
sort: { updatedAt: 'desc' }
}).exec(function(err, user) {
values.counter = user ? 0 : user.counter++;
});
```
Currently the context passed is the model prototype, why not the model ?
I could access to findOne but I got an error because _transformer is undefined.