Allow for relatedModel to be a function - discussion #23