Fix infinite recursion

The method for testing whether to include an association was causing
an infinite loop when two models referenced each other.
Merge pull request #722 from ggordon/stack_level_too_deep

Fix infinite recursion