corrects the postgres and ror .include bug adding patch of joins and ma...

Corrected the post gres and ror patch bug, kindly merge