Handling query associated model when foreign keys are not in the current model's table.