Support for ActiveRecord joins/includes

Hi Christopher,

I made a few additions to support AR 'joins' and 'includes'.

Rgds,
Nikica.

If something is missing or wrong, just make a note here, and I'll add it.