fixed bug in query generation
Merge pull request #60 from fscz/master

Fixed a bug in query generation in pgsql adapter
Support for pre-caching belongs_to associations