behrendtio/monky — pull request #16 by toogle (2014-07-16 21:50:55+00:00)
Title: Advanced reference implementation

Using special names for reference attributes (starting with an underscore) is a limited approach, which imposes restrictions on models.

monky.ref() function was implemented to overcome this limitation. It can be used with any attribute and may refer to the specific path or the document itself, e.g.:

```js
monky.factory('User', { username: 'bar' });
monky.factory('Message', { user_id: monky.ref('User', 'id') });

monky.build('Message', function(message) {
console.log(message.user_id); // 53c6e964002c233e013ff4f8
});
```