1602/jugglingdb — pull request #173 by sdrdis (2012-12-16 23:12:55+00:00)
Title: Added support for include key

Hi,

This pull request adds support, documentation and test case for the include key discussed here : https://groups.google.com/forum/?fromgroups=#!topic/railwayjs/YxcIOKEqM8w.

Examples:

- User.include(users, 'posts', function() {}); will load all users posts with only one additional request.
- User.include(users, ['posts'], function() {}); // same
- User.include(users, ['posts', 'passports'], function() {}); // will load all users posts and passports with two additional requests.
- Passport.include(passports, {owner: 'posts'}, function() {}); // will load all passports owner (users), and all posts of each owner loaded
- Passport.include(passports, {owner: ['posts', 'passports']}); // ...
- Passport.include(passports, {owner: [{posts: 'images'}, 'passports']}); // ...

I implemented also the support for mysql, sqlite3, and postgres. Just after this pull request I will launch those for these adapters.

I leaved my test case and the conditions filtering the schema, but I saw these sort of test are commented for the moment. Do I need to comment mine too ?

Don't hesitate to ask any question / improvements.

Cheers,