neumino/thinky — pull request #106 by Morhaus (2014-07-25 12:30:31+00:00)
Title: Add a Model.static() method, make _apply also work with hasOne and belongsTo relations

This allows for some nice things, such as:

```
Post.static('getView', function(view) {
switch (view) {
case 'read':
return this.getJoin({
author: {
_apply: function(user) {
return user.getView('author');
}
},
comments: {
_apply: function(comments) {
return comments.getView('read');
}
}
}).pluck('title', 'slug', 'author', 'comments');
}
});
```

Would be even better if we could ditch the `_apply` and directly pass a function. Is there a reason why we should keep using `_apply`? I've seen some examples also pass `_order` but it looks like it's been removed in favor of `_apply`.

See also #100 and #102.