Add an attribute check to the belongs_to resolution chain
Merge branch 'belongs_to_fix' into develop