Fix for eager loading of parent data in many to one relationship

The problem happens when there are two models in a many to one relationship, and you want to eager load the parent data in findAll or find queries.

Added a test and a code fix.